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 

Setting up a shadowDepthCamera


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
wernerM
User


Joined: 06 Feb 2013
Posts: 65

PostPosted: Fri Sep 08, 2017 11:28 am    Post subject:
Setting up a shadowDepthCamera
Reply with quote

Hi all!

I'm still working on my shadow technique for OpenGL 3 shaders.
I only partially manage setting the matrix for the light camera creating the shadowMap.

What I do:
        osg::Vec3 lightPositionVS = mainCamera->getViewMatrix() * lightPosition;
Quote:

osg::Vec3 eye; osg::Vec3 center; osg::Vec3 up;
        mainCamera->getViewMatrixAsLookAt(eye, center, up, view->getDistance());
Quote:
shadowDepthCamera->setViewMatrixAsLookAt(center, center+lightPositionVS, up);
That works quite fine except it doesn't honor the manipulations which are
usually done by the model matrix (scaling / translation).
So I guess I should do something like that:
        osg::Vec3 lightPositionVS = ???->getModelMatrix() * mainCamera->getViewMatrix() * lightPosition;

I have references to the view and to the mainCamera.
I found out that the model matrix is held by the cameraManipulator.
Unfortunately I couldn't find and way to get the manipulator from the references I have.
Any other things I have to care about?

Or is there any other approach in setting up the shadowDepthCamera?

Any idea?

Thanks

- Werner -



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
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 using modern shaders with osg - setti... antiro42 General 18 Fri Sep 01, 2017 9:30 am View latest post
No new posts Setting the transform matrices robertosfield General 9 Wed Aug 09, 2017 8:35 am View latest post
No new posts setting 2D manipulator bhanu406 General 1 Wed May 31, 2017 4:55 am View latest post
No new posts Setting vertex attribute array of float Bruno Oliveira General 1 Mon Mar 20, 2017 9:55 am View latest post
No new posts Need help with setting/calculating no... szadeklord Plugins [osgPlugins] 1 Wed Jun 29, 2016 12:52 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