Self shadowing

Started by
5 comments, last by ChrisE 22 years, 5 months ago
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)
Author of Power Render (http:/www.powerrender.com)
Advertisement
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
Nice
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)
Author of Power Render (http:/www.powerrender.com)
Ooooooh, that''s nice. Is this going to be added to PR4 or is it part of PR 5 now?
And how soon we''ll be able to see it in the PR ?
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)
Author of Power Render (http:/www.powerrender.com)

This topic is closed to new replies.

Advertisement