Jump to content
  • Advertisement
Sign in to follow this  
Quat

terrain lighting

This topic is 4378 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 my terrain loaded into an ID3DXMesh, and I use D3DXComputeNormals, but you can really see the triangles due to interpolation errors. It is not noticable with a texture, but is this normal? http://img359.imageshack.us/img359/4204/lighting0es7.jpg It gets worse the noisier the terrain is: http://img53.imageshack.us/img53/7311/lighting6qf.jpg By the way I am using fixed function D3D vertex lighting.

Share this post


Link to post
Share on other sites
Advertisement
Anyone can see that you are using vertex lighting and that is the problem. It is absolutely normal. Your vertex normals are interpolated along the edges of the triangles, the results are good but not the best. If you want best results, you must implement per pixel lighting using shaders. You cannot get better results than this using the fixed graphics pipeline.

Share this post


Link to post
Share on other sites
If you set your triangles up like this, it will reduce the problem.
    +-+-+-+-+
|/|\|/|\|
+-+-+-+-+
|\|/|\|/|
+-+-+-+-+
|/|\|/|\|
+-+-+-+-+

Share this post


Link to post
Share on other sites
Quote:
Original post by meeshoo
If you want best results, you must implement per pixel lighting using shaders. You cannot get better results than this using the fixed graphics pipeline.


This is not quite true. You CAN use per pixel lighting (aka normal mapping or dot3 bumpmapping) in the fixed function pipeline. This is an example for object-space normal mapping. You can also use it for terrain. It's quite easy to implement and runs even on a GF2.

Lutz

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!