Archived

This topic is now archived and is closed to further replies.

Artifacts from normalizing cube maps

This topic is 4951 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a feeling the answer to this problem must be obvious (e.g. "just get over it"), but I can''t get around it. In a basic Blinn shading pixel shader, I''m doing 3 normalizations by cubemap lookup - one each for light vector, surface normal, and half-angle vector. The visual results are absolutely "correct" except for one glaring problem - small rectangular artifacts all over the surface. Actually, due to the 3 vectors involved in the lighting formula, the artifacts are more like the interference patterns caused by little rectangles overlapping. But some sort of artifact is present no matter how many of these vectors are normalized by the cubemap method. Obviously, by its nature, a cubemap is going to discretize the normals to some extent. I have tried to reduce this effect in every way I can think of: mip-mapping vs. not, bilinear vs. point sampling, and cube texture resolutions from 32 all the way to 1024. All of these change the results in their own way, and some are significant improvements over others, but nothing changes the basic problem. With the constant reliance on normalizing cubemaps in countless papers, I feel like I must be missing something important, especially since I''m so new to pixel shaders. I just can''t believe these artifacts could be considered acceptable, considering that they cause the object to shimmer when it rotates. Not normalizing makes the specular brightness and spread wrong, but the surface shading looks 100% better. BTW, I am using cubemaps specifically because I am targeting PS v.1.4. Thanks.

Share this post


Link to post
Share on other sites
Well...get over it.
Specular lighting needs high-precision calculations,and cubemaps just don''t do the job.The higher the specular exponent is,you get more horrible results.Since you are using pixel shaders,the solution is simple:Renormalize the vectors using linear math and not cubemaps.

Share this post


Link to post
Share on other sites