PDA

View Full Version : shadow question



swarsi
01-31-2012, 09:55 AM
if someone can help with this i would appreciate it.

say i have a model and i want to draw a shadow of the model just "below" the model such that it appears that a light is above the model and shadow is projected onto a plane. since, the model may be rotated, etc. i want the shadow to reflect the orientation of the model.

can anyone give me a hint as how to proceed?

thanks

Y-tension
01-31-2012, 02:45 PM
There are standard techniques for this kind of stuff. Look into shadow mapping and stencil shadows.

Dark Photon
02-02-2012, 06:26 AM
Beyond those, google "planar projected shadows". Depends on all your requirements which one you should go with.

Kopelrativ
02-02-2012, 07:42 AM
You didnd't ask for it, but consider the possibility to use a more simple form of shadows. It is quite easy to update the shader so as to simply add some circular darkness beneath the object. This doesn't meet your requirement of "shadow is projected onto the plane", but it is very simple and use less GPU resources. It is also an alternative to offer if you want to support graphic cards that are not as powerful.