OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Simple sunlight shadow technqiue


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Roger James
Guest





PostPosted: Fri Oct 17, 2008 10:55 am    Post subject:
Simple sunlight shadow technqiue
Reply with quote

I am experimenting with a simple sunlight shadow technique using the osgShadow model and basic depth shadows. I would like to set up the shadow casting camera so that I end up with a shadow texture that is a near as possible "filled" with the shadow casting objects as culled by the LOD nodes in the scene using the the inherited viewpoint. It seems to me that the best place to set up this bounding information is during the main scene cull traverse that is done in my(most) shadow technique prior to the render to shadow texture cull traverse. I want to avoid having to manage the placing and removing of cull call backs on every shadow casting geode, which may be different as the user manipulates the scene. The only way I can think of doing this is to derive my own CullVisitor and override the Geode apply function. Have I missed something here? Is there a better way to do it? I know the LISP shadow techniques have a number of complex ways of doing this but I am trying to implement something simple that uses inbuilt OpenGL functionality wherever possible.

Roger

------------------
Post generated by Mail2Forum
Back to top
Wojciech Lewandowski
Guest





PostPosted: Fri Oct 17, 2008 1:11 pm    Post subject:
Simple sunlight shadow technqiue
Reply with quote

Roger,

I had similar dilemma at some point. I was thinking about overridding cull visitor but had problem how to substitute original cull visitor with my class in the middle of cull traversal. Finally I adopted other approach. Once Cull Visitor traverses the scene all drawbles land in render bins. Instead of overriding cull visitor I scan generated render bins and compute Bounding box around drawables that landed in renderd bins. If you are interested in details look at MinimalCullBoundShadowMap code. Its there.

Cheers,
Wojtek

Quote:
----- Original Message -----
From: Roger James (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
To: OpenSceneGraph Users (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
Sent: Friday, October 17, 2008 12:55 PM
Subject: Simple sunlight shadow technqiue


I am experimenting with a simple sunlight shadow technique using the osgShadow model and basic depth shadows. I would like to set up the shadow casting camera so that I end up with a shadow texture that is a near as possible "filled" with the shadow casting objects as culled by the LOD nodes in the scene using the the inherited viewpoint. It seems to me that the best place to set up this bounding information is during the main scene cull traverse that is done in my(most) shadow technique prior to the render to shadow texture cull traverse. I want to avoid having to manage the placing and removing of cull call backs on every shadow casting geode, which may be different as the user manipulates the scene. The only way I can think of doing this is to derive my own CullVisitor and override the Geode apply function. Have I missed something here? Is there a better way to do it? I know the LISP shadow techniques have a number of complex ways of doing this but I am trying to implement something simple that uses inbuilt OpenGL functionality wherever possible.

Roger





------------------
Post generated by Mail2Forum
Back to top
Roger James
Guest





PostPosted: Fri Oct 17, 2008 3:49 pm    Post subject:
Simple sunlight shadow technqiue
Reply with quote

Wojciech,

Thanks for the pointer, that code looks interesting. I can override the CullVisitor at the scene root so I don't have quire the same problem. I must admit this is not first time I have wished for a general per node cull callback in osgUtil::CullVisitor. It would also be a way to apply receives shadow state in a more specific fashion.

Roger

Wojciech Lewandowski wrote:
Quote:
Roger,

I had similar dilemma at some point. I was thinking about overridding cull visitor but had problem how to substitute original cull visitor with my class in the middle of cull traversal. Finally I adopted other approach. Once Cull Visitor traverses the scene all drawbles land in render bins. Instead of overriding cull visitor I scan generated render bins and compute Bounding box around drawables that landed in renderd bins. If you are interested in details look at MinimalCullBoundShadowMap code. Its there.

Cheers,
Wojtek

Quote:
----- Original Message -----
From: Roger James (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
To: OpenSceneGraph Users (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
Sent: Friday, October 17, 2008 12:55 PM
Subject: Simple sunlight shadow technqiue


I am experimenting with a simple sunlight shadow technique using the osgShadow model and basic depth shadows. I would like to set up the shadow casting camera so that I end up with a shadow texture that is a near as possible "filled" with the shadow casting objects as culled by the LOD nodes in the scene using the the inherited viewpoint. It seems to me that the best place to set up this bounding information is during the main scene cull traverse that is done in my(most) shadow technique prior to the render to shadow texture cull traverse. I want to avoid having to manage the placing and removing of cull call backs on every shadow casting geode, which may be different as the user manipulates the scene. The only way I can think of doing this is to derive my own CullVisitor and override the Geode apply function. Have I missed something here? Is there a better way to do it? I know the LISP shadow techniques have a number of complex ways of doing this but I am trying to implement something simple that uses inbuilt OpenGL functionality wherever possible.

Roger

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Happy New Year to all OSG Users Chris Hanson General 0 Mon Jan 07, 2019 10:17 am View latest post
No new posts osg-users Digest, Vol 138, Issue 27 Zachary1234 General 0 Tue Jan 01, 2019 1:16 am View latest post
No new posts osg-users Digest, Vol 137, Issue 14 poweruserm@live.com.au General 0 Fri Nov 16, 2018 11:16 pm View latest post
No new posts Shadow frustum culling Gedalia Pasternak General 4 Mon Oct 29, 2018 6:44 pm View latest post
No new posts General Users starting questions in O... A Z General 1 Mon Oct 15, 2018 3:59 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP