Shadows and Untransformed vertices

Started by
0 comments, last by Cold_Steel 21 years, 2 months ago
I just have a question about creating realistic shadows. I''ve got a model system that works really well. I load my model vertices and when I draw them, I send the model space coordinates to a vertex shader where the untransformed model coordinate is transformed into world space, and then into view space. My question is, is it possible to compute shadows in any manner using this type of system? My world is going to be positioned at 0,0,0 and all coordinates in the world will of course be in world space already. But, if I''m computing how a model casts a shadow into the world, and onto itself, wouldn''t I need the transformed world space coordinates of the model''s vertices? This wouldn''t work with my system unless I somehow get the transformed coordinates (which sort of defeats the purpose of the shader) I was thinking, however, that it might be possible to compute a sort of 3-d silhouette of my model using 3 planar meshes and simply transform that into world space each frame and somehow compute shadows from that. Think something like that would work? Does anyone know if something like this has been done before?(I need something to write my undergraduate thesis on) I can''t find too much info on advanced shadow algorithms. I read through the stencil volume shadow thing on this site.
______________________________"Man is born free, and everywhere he is in chains" - J.J. Rousseau
Advertisement
There are some algorithms, just google for example ''stencil shadows'' or ''projected shadows''.
In general, you don''t need the transformed vertices.
If you know the transformations performed on the object,
you just do the ''oposit'' transformations to the light position
and compute your shadows from that light position using the
non-transformed object.

This topic is closed to new replies.

Advertisement