Advertisement

OpenGL Shadows

Started by March 09, 2002 12:06 PM
11 comments, last by NasMan 22 years, 11 months ago
vincoof: I think it''s the right choice for his application. The nice thing about spheres is, that the stencil volume is *always* defined, and never gets degenerated, regardless of the viewpoint (assuming the viewpoint is outside of the sphere).

> and more important it needs to have hardware stenciling

That''s true.

> And it does not include smooth shadowing (which is very important to show penombras on eclipses).

To *approximate* penumbras...

I''m not sure, if he actually wants smooth shadows. NasMan, do you want smooth shadows ?? If yes: use projective textures, if no: use stencil volumes.
> The nice thing about spheres is, that the
> stencil volume is *always* defined, and
> never gets degenerated, regardless of the
> viewpoint (assuming the viewpoint is
> outside of the sphere).

And assuming that the viewpoint''s near plane does not intersect the shadow volume, unless you cap it.
Otherwise you have to use Carmack''s reverse algorithm, and then define the far plane very far (which loses depth-buffer precision).

> To *approximate* penumbras...

Well, right
For good precision, the texture to project may be at least 256x256.

But also the stencil volume "approximates" the shadow, since the sphere model itself is an approximation of the sphere mathematical definition


> I''m not sure, if he actually wants smooth shadows.

Even if he doesn''t want smooth shadows I would suggest projective shadows, because IMHO it''s (i) simpler and (ii) faster.
But, if he wants *sharp* shadows, then the stencil volumes is definately the only way to go
Advertisement
I would rather have smooth shadows...it seems like that would be more realistic looking. From what you guys are saying, projective shadows are to way to go for this...plus they''re easier to implement.

Thanks XaOs for the link.
It appears in your tutorial (I looked briefly) that the code doesn''t have to have any knowledge of the object (the Knight)(vertices etc) that is to create the shadow. It just calculates the plane and then the shadow matrix based on the light position (and the plane). Then any object in between the light and the surface gets shadowed? Is this too simplistic of an explanation? Am I overlooking something important?

Thanks you guys for the help!

This topic is closed to new replies.

Advertisement