Chunked LOD + texture splatting?

Started by
9 comments, last by GeneralQuery 11 years, 7 months ago
I want my terrain to have more than four texture splats but i'm not sure how to do it. I know that i can divide my terrain into chunks (already done) and set for each chunk 4 splats so that way different chunks can have different textures. But that doesn't work with far away chunks which can be very large (covering 256km squared, represented by a 64x64 chunk), and so likely to have more than four splats itself.

Any ideas on how to approach this?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Advertisement
Could you give some more details about your splat limit of 4 and how you are implementing the blend weights (I'm assuming textures)? At a guess, I'm assuming your 4 splat limit is tied to the colour channels of a weight texture that you bind for a given set of chunks and bind the different material textures to the 4 texture units of your splatting shader to pull their weights from the relevent colour channels. Does this sound about right?

By rigidly sticking to your 4 texture splatting limit you're going to have issues. For example, you could bind the most prominent textures that cover the largest area of a given chunk for LOD but then of course you'll have issues with textures popping into view. One way to rectify this would be to have intermediatory transition bands that mix between the different LOD texture sets based on distance from the viewer but then of course you'd need to splat more than 4 textures. Without knowing your implementation and constraints it's difficult to know what to suggest.
How are you “mapping” your splats?
One option is to use a second pass just for the splats, in which case you don’t really need to worry about anything.

Another option is to use a routine that is specific to your terrain shaders, however as long as you keep the splat textures in the same slots for each LOD, I see no reason why the splats would not behave the same, except that they adjust “level of detail” (higher and lower resolutions) per-chunk.


If you are using a system other than these, you will need to explain it, because normally these are the main ways of tackling this obstacle, and both ways results in “acceptable” splats.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Yes that's how i'm doing the splatting. I set 4 splat maps and an alpha map with weights in the RGBA channels for every chunk.

I considered assigning a priority to textures for far chunks but that would cause popping like you said.

Edit: @L. Spiro: I'm not sure how in the first option i wouldn't have to worry about anything? Do you mean use more than one alphamap per chunk?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
You could store the weights for each chunk of a given size in an array texture and dynamically loop to splat an arbitrary number of textures. For each chunk, you'd pass the number of textures required (edit: i.e. the number of loop iterations), along with the array texture element and colour mask (a 4D vector with the colour channel to be sampled set to 1 and the rest set to zero) edit: for each texture. Multiply the colour mask by the rgba weight sample and sum the resulting components to get the weight for a given texture. The performance might be sketchy on older hardware, especially if the max number of textures for any given chunk is quite high.
So basically just add more alpha maps/weight channels?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "

So basically just add more alpha maps/weight channels?


If you want to splat more than 4 textures for a given point on the terrain mesh then yes, unless you bypass the blend weight textures altogether and algorithmically decide what textures should be splatted onto a given point or compress multiple weights into a given colour channel. The former will restrict direct artistic control, however, unless you use your existing weight textrues for this purpose and use these as the artistic "paintable" blend weights.
I'm painting the terrain in my editor so no procedural stuff. I guess i'll just add more channels then.

As a side not, wouldn't it be better performance wise to use splatting only on chunks closer to the camera and some other technique on farther ones?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "

I'm painting the terrain in my editor so no procedural stuff. I guess i'll just add more channels then.

As a side not, wouldn't it be better performance wise to use splatting only on chunks closer to the camera and some other technique on farther ones?

Texture splatting is an insalenly efficient technique on modern hardware, it's basically few texture samples and LERPs per fragment. You could bake a low resolution colour texture based on your splat weights for distance stuff but I'm not convinced it's worth the time, effort and resources for marginal performance gains (if any at all, or even worse perforance!).

Edit: a common technique for texture splatting is to sample low and hi res textures, with the former being used for distant geometry. You then overlay said hi-res texture onto the low res texture for fragments within a set distance from the viewer. You'd need a transition band for this, though, otherwise there'd be a noticble circular band where the low and hi res fragments meet.
I'll stick to texture splatting then.

One last question. I'm not sure what the colour mask is used for?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "

This topic is closed to new replies.

Advertisement