Jump to content
  • Advertisement
Sign in to follow this  
blue-ice2002

lighting in isometric

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

hello,im writing an isometric terrain engine in direct3d,and i can make hills by changing y values of quads. But when i want to shade the hills,i mean also light them, there is a problem,i need to find normals of every vertex,but because the hills are on the same xy plane,visually they are 3d, but normals will be same,cause they are on the same plane,so all the vertices will face the light source with the same angle. so is there another way to light them or not?

Share this post


Link to post
Share on other sites
Advertisement
yup, you can calculate normals by triangles slope. acctually it is 2d but you can work with 3d triangles, because you have x,y coordinate and also z (height). and voala now you have "real" 3D hills and you can calculate its normals...[smile]

Share this post


Link to post
Share on other sites
I imagine the hills are created from some heightmap or each vertex gets its own height in the mesh. I found it much nicer to use flat-lighting (using face normals) of the triangles instead of smooth lighting (vertex normals). You calculate then normal of the triangle using its three vertices: n = normalize(cross(v1 - v2, v1 - v3)).

Share this post


Link to post
Share on other sites
you are right,but the problem is not with taking cross product.

because my rendering is isometric and it means its fake 3d,not geometrically 3d
all the vertices are on the same plane and it means,if u calculate normals they are the same,so there is no shading at all.

Share this post


Link to post
Share on other sites
But as I pointed out, you can do a fake lighting with your z variable. for example if you have triangles that slope down-right, you can shade them and you can achieve some fake lighting. Other ones which don't slope that way just don't shade, or just put some light rnd on ambiental light :)

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!