Jump to content
  • Advertisement
Sign in to follow this  
esfoos

Smooth shading on polygons in DirectX

This topic is 3996 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

Any tips on how to achieve smooth lighting / shading on polygons in directx based real time rendering engines? It seams the the more "extreme" or varying a surface is in angles and elevation, the more pronounced the shading on individual edges and polygons become. I am developing in Maya. Attached are images of the polygonal surfaces in Maya, and in our game engine. I cannot find a way to reduce and/or eliminate the severe spiking in the shading.

Share this post


Link to post
Share on other sites
Advertisement
The images don't seem to be attached, but I think I get what you mean. Often these so-called hard edges indicate a lack of tesselation or indeed extreme differences in adjacent surface normals. There is no magical setting in DirectX that will solve this, so you'll either have to smoothen (average) the normals of adjacent surfaces in code or do this in your modelling package.

Maya seems to have just such an option in the Normals menu (in the Polygons workspace) called "Average Normals". I've never used this before, but I'd say it's worth a try.

Share this post


Link to post
Share on other sites
All edges are softened. I usually follow 3 steps after adjusting my surfaces:
- merge all vertices at a very low tollerance (0.005) to ensure everything is watertight.
- set all vertex normals to face, kind of a forced reset
- select all edges and soften all, with a tollerance of 180.

I will try averaging the vertex normals, but in the past this resulted in a muddy rendering. It removes all highlights & shadows from the surfaces when rendered in directX. Mayby laying prerendered lightmap over the averaged vertices would work?

I posted the image at:

http://www.ericfoos.com/terrain-shading.jpg

terrain-shading.jpg


Appreciate your input very much.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!