Geomorphing terrain normals

Started by
3 comments, last by Hiyar 14 years, 9 months ago
Hi all I'm calculating my terrain normals on the fly in the vertex shader and so far, everything's look pretty good. My terrain uses the chunked LOD technique (or at least is based on it) and I also do geomorphing between LOD levels. Without terrain lighting, you can barely notice the terrain levels changing, but it becomes a bit more apparent with lighting switched on because when a LOD level changes, although the geometry initially matches the lower LOD level, the normals switch immediately. I'm just wondering if it's worth geomorphing the terrain normals as well. Has anyone done this before? Thanks
Advertisement
I personally use a single global high-res normal map for the terrain, which is pre-generated. Actually I currently generate it from the heightmap during initialisation, but in the end it's the same.

If you set your screen-space error constant to the correct amount you can't even see the transition between LOD levels most of the time since the lighting is preserved and any artefacts introduced are so small in screen space you don't notice them.

Of course this doesn't allow for terrain deformation, but there is no reason why you can't generate the normal map each frame instead using a simple 4-tap filter it adds minimal performance overhead. In fact I intend to add this to my terrain once I start work on terrain deformation, it's just not needed now and would be a simple change to make.
I used to do it that way but with a 4096x4096 terrain, a pre-generated normal map takes up a fair chunk of memory. I just do a 4-texLod lookup in the vertex shader and average the normals, the performance penalty, as you say, is minimal.

So when you say:

Quote:you can't even see the transition between LOD levels most of the time since the lighting is preserved


What do you mean by that? For low(er) LOD levels, are you just using the vertex normals for what would be the highest LOD level (i.e. your pre-calced normal map)? That's essentially what I do - when doing the texLod lookups (into my terrain vertex displacement map), I always use +1/-1 for the 'next vertex' along rather than what would be +2/+4/+8, etc depending on LOD level.

My change isn't massively noticeable but it certainly isn't as smooth as my geomorphing. If your LOD changes are small in screen space, you must have a very small error?
Quote:Original post by RobMaddison
So when you say:

Quote:you can't even see the transition between LOD levels most of the time since the lighting is preserved


What do you mean by that? For low(er) LOD levels, are you just using the vertex normals for what would be the highest LOD level (i.e. your pre-calced normal map)? That's essentially what I do - when doing the texLod lookups (into my terrain vertex displacement map), I always use +1/-1 for the 'next vertex' along rather than what would be +2/+4/+8, etc depending on LOD level.


When looking at a scene it's usually very difficult to indentify which areas are low-LOD and which are high, since as you say, I'm always using the normals for the highest LOD level.

Quote:My change isn't massively noticeable but it certainly isn't as smooth as my geomorphing. If your LOD changes are small in screen space, you must have a very small error?


My error is quite small, but it cuts out enough vertices for me. 99% of the time my scene is viewed from ground level anyway, so I'm not rendering a vast amount of vertices. The LOD only really comes to play when on top of a mountain or similar.

EDIT: As an additional point, I'm using skirts rather than geomorphing. Since my error value is low they are barely noticable. Unless you really look for them in areas of high geometric complexity and change.

[Edited by - adt7 on July 21, 2009 10:35:43 AM]
Hi,
I'm just using the heightmap texture in the pixelshader to compute the normals (also slope etc.) I think this looks good enough for me.

I don't use geomorphing I think this is not necessery. But this is just my opinion.

This topic is closed to new replies.

Advertisement