A shadow theory.

Started by
6 comments, last by Andos 20 years, 11 months ago
I''m not 100% into the ideas of all those shadow algorithms, but i came up with an idea last night. I don''t know if this is fast or anything, but i supose it could be used: When you are about to render the model shadow, you use an algorithm that not renders the model from the light source, but simply calculates all screen cordinates of the object with the ''camera'' position at the light source. The algorithm detect all the outer screen points on 2d. Then you have a single polygon with many vertices. You fill this polygon and you have the shadow. Would this be slow or would it work fine? (note: i do not think of using this to anything because i can not program 3D, i was just wondering if it could be used)
Advertisement
That was a bit sketchy (especially the last bit where you ''fill the polygon''), but it sounds like if you develop your ideas you''ll reach something quite similar to shadow volumes.

They work, and can be made reasonably quick for most scenes.
Hes right your essentialy explaining a more complicated version of shadow volumes
It sounded to me like he was trying to make a screen-space shadow algorithm.
Yea, what it sounded like to me, he says transform to image space, find all the outer vertices that make up the model, connect them to create a new polygon, render and then project it onto the floor plane. Might be wrong though, although, hes the only one who can really explain, so i''ll let him :D
*st0ned*
Yeah... That was what i meant.
Sorry if i was unclear, i''m not that good at english.
So how does shadow vloumes work?

I just read an explanation of stencil shadows, and it basicley renders the model from the lightsource and makes it black and semitransperant and maps it on the terrain or objects...
so you basically cut the model with the ''cone'' of light, transform it into screen cordinates, and render it as transparent black.

That would not do self shadowing. That''s the whole point of the shadow volume technique. By using the volume of light''s back face and front face, you can detect shadowed regions that are still in the cone of light (when an object is closer to the light and cast a shadow).

A quicker way of doing your method is to just use a texture projection matrix, although the quality would not be as good (it will look more ''grainy'' on some surface, because all you would do is project a texture).

Everything is better with Metal.

also, the shadow volumes work with directional lights and point lights, and work well with objects close to the light source (using infinite projection matrices and carmack''s reverse). Your algorithm would not work with a directional light, or a point light, and the cone of light would have to have a reasonable angle.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement