Skip to main content
gamedev.net
🔒 Locked

directx lighting

Started by stickben 2 replies 650+ views
Original Post
stickben
stickben
Hi!, Im really new to the directX community and I was wondering if someone could give me a hint about how to do lighting. Currently I have a program that generates terrain and puts a texture over it, I can adjust the levels of lighting, but there is no shadow around the tops of peaks, and it always looks the same no matter what angle you look at it. Any sugestions? Thanks! Ben
Cold_Steel
Cold_Steel
Do mean that the back side is not dark at the top of the peak like it should be? If you do, you may need to adjust the normal vector at the vertex or vertices that form the peak. If the vertex is for both a front face and a back face, and the normal is and average between the two, then it may not look right. To may need to point that vertex normal away from the light some more. This only applies if you are lighting per vertex. IF you are lighting per face, then I have no idea what''s wrong. Hope this helps.

________________________
Grab your sword, and get prepared for the SolidSteel RPG engine, coming soon...(i.e. when it''s done)
______"Man is born free, and everywhere he is in chains" - J.J. Rousseau
stickben
stickben
OK, ya I think its the normals, right now every normal was set to 0,0,0.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.