Hi Robert,
I am struggling with building decent ShadowMapping approach for flight sim
application. Due to performance requirements I am hesistant to use multipass
PSSM and I am trying to implement (one extra pass only) some kind of
perspective shadow mapping derived algorithm. I went through Trapezoidal,
Smallest Bounds, LisPSM. Effective computation of minimal shadow scene
bounds + LisPSM gave me fairly good results. But this apprach fails when I
have badly conditioned database. Few huge drawables that are spread over
whole terrain kill effectivness of minimal bounds computation. They have
such big bounds that minimal bound computaion simply does not help at all,
and I end up using camera frustum as shadow bounds.
So now I am contemplating addition of one prerender pass (ie second extra
pass ;-( ). This pass would be used for computation of minimal bounds of
visible scene portion based on an depths rendered to texture. Problem is I
would like to make this depth analysis pass before actual ShadowMap, Scene
camera and TexGen setups are done during cull phase. In other words I would
like to have the chance to do scene prerender culling and rendering before
final scene culling and rendering. Is this possible ? Any suggestion for OSG
examples to browse ?
Currently my ShadowMap algorithm looks like this (its exactly the same
control flow as in osgShadow::ShadowMap)
My Shadow Map technique Cull
Cull Scene Receiving Shadows for final Screen output render
stage
Find Light source casting shadows
Compute Bounds of Scene Receiving Shadow visible portion
Setup Shadow Map camera View and Perspective matrices
( based on Scene Bounds and Light source )
Cull Scene Casting Shadows for Shadow Map prerender stage
Add shadow coordinates TexGen to final Screen output render
stage
End My Shadow Map technique Cull
Rendering of RenderStages is executed in following order
Shadow Map prerender stage
Final Screen render stage
What I would like to achieve looks like this
My next Shadow Map technique Cull
Cull Scene Receiving Shadows for final Screen output
Find Light source casting shadows
Depth Analysis prerender pass
Cull & Render scene producing Depth texture
( view and projection are the same as in Scene
Receiving Shadow pass,
target texture resolution 8x-4x smaller than screen)
Compute Bounds of Scene Receiving Shadows based on image
produced in Depth
Analysis pass
Setup Shadow Map camera View and Perspective matrices
Cull Scene Casting Shadows for Shadow Map prerender
Setup shadow coordinates TexGen for final Screen output
End My next Shadow Map technique Cull
Rendering of RenderStages is executed in following order
Shadow Map prerender stage
Final Screen render stage
Cheers,
Wojtek
P.S. When I sort all the issues I could contribute some of this work
(Minimal Bounds Shadow map, LisPSM) to osgShadow portfolio if you are
interested.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org