Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Wide landscapes (>8192 pixels)
- - By Sven2 [de] Date 2012-03-31 19:31
So I just noticed the landscape renderer crashes when the surface is >8192 pixels. Are there any technical reasons why this is nontrivial to fix?
Parent - - By PeterW [gb] Date 2012-04-01 16:04
What kind of crash? I certainly didn't build it with any sort of limitation in mind, but the graphics driver might have other ideas.
Parent - - By Sven2 [de] Date 2012-04-01 16:19
The update function updates only the first texture of a surface; but wide surfaces consist of multiple textures.

Just create a wide landscpe (e.g. 1200 pixels at map zoom 8) and run the engine. You will get an access violation in the offending update function, where it tries to access memory outside the texture range.

That one would be relatively easy to fix. I'm just wondering if there are additional, more fundamental problems with it (such as that it can only work if the whole landscape resides in a single texture).
Parent - - By PeterW [gb] Date 2012-04-01 22:24
Well yes, the shader does some local lookups, so you can't simply tile it without special preparation. I wasn't aware that it starts tiling at 8192 - I thought I disabled that? Where is the code that causes that?
Parent - - By Sven2 [de] Date 2012-04-01 23:29
My guess is 8192 is the max texture size?
Parent - - By PeterW [gb] Date 2012-04-02 14:21
You mean the maximum texture size for your GPU?

Well, in case we really want to support bigger landscapes, we could either only keep parts of the landscape in a texture and move the covered rectangle as required - which would probably cause lag if you scrolled quickly from one side of the landscape to the other. The other alternative would be to tile it, and add a few context pixels on each side so the shader has enough information.
Parent - - By Sven2 [de] Date 2012-04-02 14:41 Edited 2012-04-02 14:56
8192 is OK for now I guess, but it's not that large either. I do have to modify my scenario for this :(

Large textures used to be a performance problem, as you would access large ranges of memory even when reading just a small square within the texture. I don't know whether this is still true on modern GPUs though, but it might be worth profiling this.

Also, other GPUs might have different restrictions.
Parent - - By Maikel Date 2012-04-02 18:04
I have the same restriction (or at least the crash) on a modern gpu (gtx 580).
I don't see the need why the landscape has to be that large for what you have in mind, the player can also be forced to move in circles, or other shapes.
Parent - By Sven2 [de] Date 2012-04-02 18:56
Sure it's possible. It's just that I don't like having such an arbitrary restriction :(
Parent - By PeterW [gb] Date 2012-04-03 11:37
Yeah well, all I'm saying is that it isn't just a question of using the existing tiling stuff in CSurface. So technically possible, sure - but there were too many questions involved for me to implement it right away.
Up Topic Development / Developer's Corner / Wide landscapes (>8192 pixels)

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill