GeoMipTerrain and texturing

Hi, I’ve got a couple of problems that I’m trying to work out

I’ll start with the simple one,
how do you texture terrain using multi-texturing but with different textures for different parts?
Let me rephrase that, I want to have a terrain where the high points are white and snowy while lower down its got grass and dirt, but in order to do that I have to use something like the interpolate texture combine mode, but since I need texture scaling (the textures repeat many times over the terrain), I can’t see how that would work unless I made HUGE textures with the repeats embedded (and thats just silly) so im assuming that there is some trick I’ve missed?

My second problem is about GeoMipTerrain and a bit more in depth, but presumably pro-rsoft could solve it (since he wrote GeoMipTerrain),
I was trying to understand what the “quality factor” actually did, so I looked at the paper the code was based on, and from what I can tell it used a different way to set quality, by setting the minimum distance before each block would switch to a higher resolution, it also had a second system which checked whether distant block should be high quality anyway by looking at their delta change (or popping amount) from the cameras POV when changing from lower to higher quality…
this is clearly quite a lot more complex than the simple setFactor call, so I assume setFactor is just a simplification of this? Are the original settings still accessible, just not documented?
If this is not so, vaguley how does setFactor work? I’m trying to make it so that if my heightfield class is passed a higher resolution image, it will output a higher resolution terrain (read: better, not bigger) but the problem is that no matter what I set blocksize and setFactor to, they only seem to produce good results for 1 size of image and I need to know how to modify the numbers I put in them to give similar results for any size of terrain.

Lastly, just a quick question, does scaling textures and/or fog work with shaders turned on in 1.6.0? i tried turning shaders on to see what improvements it gave in 1.5.4 and the results were pretty ugly :smiley:

Check the Nature Demo sample – it has a shader that does exactly that.
You could also use combine modes, but it’s hard to stay under the texture stage limit then.
GeoMipTerrain has also a makeSlopeImage function which gives an image thats white where theres a large slope, and black where there terrain is flat. Might come in useful for that kind of stuff too. Dunno when that function was added though, it might not be in 1.5.4 yet.

Texture scaling works fine for me. It doesn’t work with the shader generator yet, but the SG doesn’t support combine modes either. If you’re using your own shader, you can scale the texture in the shader.

Actually, the setFactor works different than in the paper.
The upcoming 1.6.0 release will have a better system (with near/far) that works more like that.

Uh, nope. Screenspaceerror-based level selection is not implemented yet.

It basically boils down to something like this, internally: (pseudo-code)

for block in blocks:
  block.level = distance(block, focalpoint) / factor
  if block.level < minlevel:
    block.level = minlevel

With the shader generator, TexMatrix isn’t supported yet, unfortunately. I don’t think fog either.

Thanks, that has cleared up a lot of confusion :slight_smile:

EDIT: how do i get hold of the nature demo sample? the original thread has dead links.