Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

baskuenen

Faster Shadow Volume Found - Prove Me Wrong...

This topic is 5502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?...

Share this post


Link to post
Share on other sites
Advertisement
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-)!?!

Share this post


Link to post
Share on other sites
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???

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!