Archived

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

Self shadowing

This topic is 5895 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''ve been working on stencil buffers in the last 2-3 days. Here are a couple of screenshots of my success so far. These are animated skinned characters using the inverted Carmack stencil volume shadow method. http://www.powerrender.com/powerrender/gallery/selfshadow1.jpg http://www.powerrender.com/powerrender/gallery/selfshadow2.jpg Author of Power Render (http:/www.powerrender.com)

Share this post


Link to post
Share on other sites
Wild. It looks good.

1. Will that work on all graphics hardware?

2. How does it work? Is it something like PR_SetLightCastsShadows(lightnum), or is it more PR_SetEntityCastsShadows(entity)?

-Rich

Share this post


Link to post
Share on other sites
1. No. Stencil volumes need stencil buffer support.

2. I''ve created a new interface PRSE_*, (PR Shadow Engine) for these functions. Once finished it will be easy to incorporate with the high level engine and be used as an alternative to the soft shadows. You can also use the routines directly and apply shadows to anything.

First you initialize the shadow volume given a mesh, character or BSP. I haven''t done BSP''s yet but the other two are working.

PRSE_InitializeEntityVolume (&My_Shadow, entity_mesh);
OR
PRSE_InitializeCharacterVolume (&My_Shadow, entity_character);
OR
PRSE_InitializeBSPVolume (&My_Shadow, entity_bsp);

Next you build the shadow volume from the light position:

PRSE_BuildVolume (&My_Shadow, ShadowLightPosition);

Then you call a function which renders all the shadow volumes after the regular scene and applies shadows (like stencil1 example).

Using this technique you can have a number of static shadow volumes either from BSP or meshes. You''ll be able to store these as static vertex buffers and render them fast. For animated objects you''ll have to rebuild the volumes each frame.
Of course if your light position changes you''ll have to rebuild all the volumes, but if you can lock the position of your sun (ie a game like Shrek for XBox) it should be very nice.

I have to work on bsp shadows, culling volumes early, LOD support for lower detail shadows, and a few other precision issues.


Author of Power Render (http:/www.powerrender.com)

Share this post


Link to post
Share on other sites
Shadowing routines are coming along nicely.

* You can use either point or parallel lights.

* Biped and morphing characters are fully working.

* You can choose to either project every triangle in the volume or use edge connectivity to quickly find the silhouette of the object and reduce the triangles in the shadow volume (works 95% of the time).

* Bounding boxes are optionally computed on the shadow volume so the can culled early. These have to be independent of the object''s bounding box because you might see the shadow but not the object it came from.

I will be working on BSP shadows and also LOD so you can use a lower detail version of the object for the shadow volume. In addition I hope to fix a couple of important bugs : cracks in LOD models and directional lighting on skinned meshes.

When that is ready I''ll release new libraries and headers for everyone.






Author of Power Render (http:/www.powerrender.com)

Share this post


Link to post
Share on other sites