Faster Shadow Volume Found - Prove Me Wrong...

Started by
25 comments, last by baskuenen 20 years, 5 months ago
I think I''ve found a speedup in the standard shadowvolume algorithm. This reduces the amount of triangles to be rendered for point-lightsources. The normal z-fail algo goes like: 1 - draw extruded silhouette edges 2 - draw dark cap at infinity 3 - draw light cap normal My speedup would be: 1 - draw extruded silhouette edges 2 - draw light cap inverted (back faced instead of front) at infinity 3 - draw light cap normal Imagine a sphere to be shadowed with a point lightsource. There are often (but not always) more dark faces than lighted ones. In any case there are never more lighted faces than dark faces. So using the light faces reduces the amount of faces to be rendered... Can you prove me wrong?...
Advertisement
Concave objects.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Another side effect of this is...

When a light is INSIDE an object. Parts or the whole object doesnt cast a shadow. When some faces of the object still face the light, this can result in a weird shadow (but still closed), and at the same time prevents a huge hit on the fillrate.

A weird shadow is not what we''re waiting for, I know.
But this weirdness could be a very small effect, especially for models constructed from an x amount of smaller meshes (head/arms/legs/...).
When a light accidently collides with an arm, wouldnt you rather have the rest of the world (exluding the arm) rendered with cool and fast shadow, than opt for the slow shadowing of the whole world (read: -no lighting at all-)!?!
quote:Original post by ApochPiQ
Concave objects.


Concave objects should be fine I think. The shadow volume remains closed.


I''m not an old-white-bearded-scientist, so I cant imagine I''m the invertor of this technique... but what am I missing???
ChrisE, near the bottom of this page seems to suggest that Doom3 used that sort of inverse method in it''s stenciled shadows.

My expertise isn''t shadow volumes, so, even if I *had* seen it used, I probably wouldn''t notice to remember it.
-------
[shameless plug]
Hey, while you''re working on shadows, join my little group of peoples working on better terrain shadows :D
[/shameless plug]

I thought you were a busy game dev worker or something now, otherwise I might have bugged you earlier .

-Michael
Explanation of the "concave objects" remark
Take a simple sphere mesh, and then CSG subtract it from a cube. The result I''m imagining would look something like the chalk used on billiards cues (i.e. a cube with most of one face turned into a spherical dent). If the light originates directly above the dent, each of the faces in the dent and on the surrounding edge is lit, while the 5 other faces of the object are unlit. You''d need more than 5 faces to nicely represent the dent, so you now have more lit than unlit faces. Your speedup no longer gains us any advantage. It doesn''t break the shadow volume algorithm at all, but it isn''t faster, either.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

quote:Original post by ApochPiQ
Explanation of the "concave objects" remark
Take a simple sphere mesh, and then CSG subtract it from a cube. The result I'm imagining would look something like the chalk used on billiards cues (i.e. a cube with most of one face turned into a spherical dent). If the light originates directly above the dent, each of the faces in the dent and on the surrounding edge is lit, while the 5 other faces of the object are unlit. You'd need more than 5 faces to nicely represent the dent, so you now have more lit than unlit faces. Your speedup no longer gains us any advantage. It doesn't break the shadow volume algorithm at all, but it isn't faster, either.


You're right that it in this case more triangles need to be rendered... but the average amount of faces would still be lower.
Imagine your scene.. then rotate the LIGHT 360deg around the chalk-object. The average amount of faces lit is still lower than half of the total amount

[edited by - baskuenen on November 14, 2003 2:30:33 PM]
quote:
Imagine a sphere to be shadowed with a point lightsource.

There are often (but not always) more dark faces than lighted ones. In any case there are never more lighted faces than dark faces.


If a sphere was to be shadowed by a point light source, i''d say in average 50% of its faces would be lit, and 50% would be shadowed, independantly of the view point.

In addition, i fail to see how you come up with your assertion that "there are never more lit faces than dark ones". Taking a standard scene with many viewpoints, i guess you''d find the ratio around 50% too. Or am i missing something obvious here..?

Y.
quote:Original post by Ysaneya

If a sphere was to be shadowed by a point light source, i''d say in average 50% of its faces would be lit, and 50% would be shadowed, independantly of the view point.


You''re right if we''d be talking about directional lights.

Imagine the light to be very close to the object...

Yeah, if it''s very close to the sphere. But then in that case, it''d be far away from other objects. All in all, in average, i doubt you''ll see more than 50% of dark faces.

It''s like backface culling. In average, 50% of the faces are backface culled.

Y.

This topic is closed to new replies.

Advertisement