Normal artifacting exposes underlying topology

Started by
13 comments, last by marcClintDion 10 years, 9 months ago

same...

Consider it pure joy, my brothers and sisters, whenever you face trials of many kinds, 3 because you know that the testing of your faith produces perseverance. 4 Let perseverance finish its work so that you may be mature and complete, not lacking anything.

Advertisement


Hmm. Suppose instead of running the normals through the geometry, I uploaded to a texture and then sampled them per fragment? That would create a bilinear interpolation across all four corners that's independent of tessellation and might just get me out of trouble.


Yeah, this works quite well. It has an advantage that you no longer need to have vertex normals / tangents / binormals passed through the vertex pipe reducing bandwidth in the vertex shader too. The texture coordinate can be derived from the position, and as you pointed out - its effectively bi-linear filtered across the quad, as opposed to the interpolation that happens across the triangle.

Another alternative, which i have tried before is to triangulate the quads based on their slope direction. Always cut the quad across the diagonal that's closest to being vertically flat.

No, I'm wrong, I should have put that more tactfully.

You wrote that you tried normalizing in the fragment shader and that this had no effect.

Could it be that you only normalized one of the two terms that are used in the diffuse lighting calculation. As follows,

//=====================================================================================================

float3 N = normalize(normal); // It seems to me that if you do not normalize both of these in the fragment shader
float3 L = normalize(lightPosition - P); // then you will not see any benefit, it will still look like the image you posted.
float diffuseLight = max(dot(L, N), 0.0);
//=====================================================================================================

The image that Promit posted represents, in his own words, the normals as colors. There are no lighting calculations being performed at all. Thus, the result will represent linear interpolation whether it is computed in the pixel shader, in the vertex shader, or in the fixed-function pipeline (unless specific steps are taken to use another type of interpolation).

That's why everyone is saying that the image represents the expected result.

-~-The Cow of Darkness-~-

I solved this problem using catmull-rom interpolation for the terrain heightfield

combined with runtime calculation of normals using bspline interpolation

bspline has C2 continuity ... no artifacts!

but it is expensive ...

http://skytiger.wordpress.com/2010/11/28/xna-large-terrain/

Oh..... I'm still embarrased? rolleyes.gif

Consider it pure joy, my brothers and sisters, whenever you face trials of many kinds, 3 because you know that the testing of your faith produces perseverance. 4 Let perseverance finish its work so that you may be mature and complete, not lacking anything.

This topic is closed to new replies.

Advertisement