Archived

This topic is now archived and is closed to further replies.

opengl_coder

Where can I find a good shadow tutorial?

Recommended Posts

I have looked for a good dynamic shadow tutorial for many weeks now, but I have not found one. I want my character to cast shadows on the floor and on the walls in my project. Does anybody know of good a shadow tutorial that is fairly easy to implement? cheers opengl_coder

Share this post


Link to post
Share on other sites
I am using this algorithm (with some modifications), and it works great.
However, it has a small bug. Replace:

dot = fPlane[0] * fLightPos[0] +
fPlane[1] * fLightPos[1] +
fPlane[1] * fLightPos[2] +
fPlane[3] * fLightPos[3];

with

dot = fPlane[0] * fLightPos[0] +
fPlane[1] * fLightPos[1] +
fPlane[2] * fLightPos[2] +
fPlane[3] * fLightPos[3];



Height Map Editor | Eternal lands

Share this post


Link to post
Share on other sites
Look out for 'shadow volumes'. A good starting point is

www.gamasutra.com/features/19991115/bestimt_freitag_03.htm

If you want to see some shadow-algorithms in action, download my application which deals with shadows here:

www.gerogerber.de/3dshadows

Hope this will point you in the right direction,
Gero

[edited by - gerogerber on December 26, 2002 6:39:37 AM]

[edited by - gerogerber on December 26, 2002 6:41:52 AM]

Share this post


Link to post
Share on other sites
Id hardly call the one on nehe.gamedev.net good.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack

Share this post


Link to post
Share on other sites