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 

When gets the view matrix of a camera ipdated


 
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: 66

PostPosted: Sat Nov 18, 2017 4:08 pm    Post subject:
When gets the view matrix of a camera ipdated
Reply with quote

Hi all,
I have written some classes for special effects like ambient occlusion or shadow.
All those classes are using their own prerender cameras. The cameras use the initial draw callback for updating their view matrices by using the main cameras view matrix.
Unfortunately it looks like the rendered shadow/ ambient occlusion matrices correspond to the previous frame. So my guess is that the view matrix of the main camera isn't updated from the camera manipulator at the time of the callback.
Is there any better callback I can use for that?

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Sat Nov 18, 2017 6:00 pm    Post subject:
When gets the view matrix of a camera ipdated
Reply with quote

Hi Werner,

The initial draw callback is called at the start of the draw traversal
for that Camera's rendering graph, this rendering graph is populated
by the cull traversal which happens prior to the draw traversal, this
includes all the accumulation of all the matrices in the scene graph
into final modelview matrices, so changing the Camera's view matrix
during the initial draw callback won't affect the rendering result for
that frame.

You should set the Camera's view matrix in the update or at latest
cull traversal. Have a look at the RTT Camera's in the osgShadow
library.


Robert.


On 18 November 2017 at 16:06,
<> wrote:
Quote:
Hi all,
I have written some classes for special effects like ambient occlusion or
shadow.
All those classes are using their own prerender cameras. The cameras use the
initial draw callback for updating their view matrices by using the main
cameras view matrix.
Unfortunately it looks like the rendered shadow/ ambient occlusion matrices
correspond to the previous frame. So my guess is that the view matrix of the
main camera isn't updated from the camera manipulator at the time of the
callback.
Is there any better callback I can use for that?






------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Thu Nov 23, 2017 11:25 am    Post subject:
When gets the view matrix of a camera ipdated
Reply with quote

Hi Werner,

On 23 November 2017 at 11:02, Werner Modenbach
<> wrote:
Quote:
many, many thanks. That was exactly the cause of the problem.
I changed the callback to be an update callback and the delay is gone.
Better to say: almost gone.
When I turn my object via camera manipulator there seem to be no update
callbacks.
Is that right? Is there any way to get also this case catched by a callback?

By default OSG doesn't differentiate between frames based on what
drives the frame. A viewer.frame() will always call the the update
traversal which should in turn call all the update callbacks in the
scene graph.

I don't know what is happening in your application, I know nothing the
application your have, there is no way I can guess what might be going
wrong. It's technically possible to override default osgViewer
behaviours, whether you do or not is only something you can answer.

All I can say is the in a standard osgViewer based application event
handlers like camera manipulators don't have any affect on whether
update callbacks are called or not on the next frame, as long as the
viewer.frame() is called appropriately an update traversal will
happen.

Robert.


------------------
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 Resizing an FBO camera with OSG 3.2.0 James Turner General 0 Fri Dec 08, 2017 9:07 pm View latest post
No new posts How to simulate camera distortion ? blackball General 3 Fri Dec 08, 2017 11:16 am View latest post
No new posts TBN Matrix for Normal Mapping - OSG a... romulogcerqueira General 5 Tue Nov 07, 2017 8:48 pm View latest post
No new posts model matrix d_a_heitbrink General 0 Tue Oct 24, 2017 3:33 pm View latest post
No new posts Camera collision with terrain ht11 General [3rdparty] 0 Fri Oct 13, 2017 7:34 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