[osg-submissions] possible usefull extension to osgShadow::ShadowMap reformatted

Sebastian Messerschmidt Sebastian.Messerschmidt at gmx.de
Mon Mar 3 00:51:05 PST 2008


Hi,



This patch includes two things:

1.) The polygon offset was hard-coded and I somehow had troubles 
overwritting this state deeper in my shadowed scenes. That's why I've 
added getter/setter methods for the polygon offset (saves trouble with 
nvidia and recent ati drivers ;-))

2.) Introduced 2 methods (setDone, setOneShot) to allow (re)sampling of 
the shadow map when desired. The oneshot-method can be thought as 
setting the shadow-sampling to a special mode, where the'done' flag is 
actually taken into account. The done flag indicates if sampling has to 
be done for the current traversal. By resetting the 'done' one can force
resampling of the map. (I use this since my scene and lights are static 
for a big number of frames but may change any time)

I'm new to osg and I wonder if this could be done a little more 
intelligent ( I guess this should be done by changing the culling 
traverse strategy somehow ...)

Please give me some feedback on this. I have some more ideas/improvements.

P.S. I developed some kind of Unified Shader for per-pixel lighting with
optional shadowing that supports different lightsources ( effectively by 
using the glsl-preprocessor). Do you thing thak might be usefull to anyone?

cheers
Sebastian 'psy' Messerschmidt


-------------- next part --------------
A non-text attachment was scrubbed...
Name: osg_shadowMap_patch_psy.rar
Type: application/octet-stream
Size: 7973 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080303/4a6416f7/attachment-0001.obj 


More information about the osg-submissions mailing list