# lighting in isometric

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

## 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 on other sites
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 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 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 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 :)

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 10
• 9
• 35
• 16
• ### Forum Statistics

• Total Topics
634125
• Total Posts
3015670
×