Werner Modenbach
2018-06-25 10:10:46 UTC
Hi all,
I'm experimenting with slave cameras for a while now and now I'm totally
stuck.
I'm doing a tiled display of a scene and for the main scene graph it
works fine with projection offset matrix on the slave cameras
and all cameras having a RELATIVE reference frame.
But my scene also has cameras with ABSOLUTE reference frame (i.e. a
background image).
The background is - of course - fully mapped on each tile.
In order to solve this I modified my vertex shader like that:
  Â
gl_Position=osg_ModelViewProjectionMatrix*projectionOffsetMatrix*osg_Vertex;
and I populate the projection offset matrix via uniform (same as slave
offset matrix). Unfortunately without the expected success.
For creation of osg_ModelViewPrtojectionMatrix I found this code:
   osg::Matrixd modelViewProjectionMatrix = modelMatrix * viewMatrix *
_camera->getProjectionMatrix();
   uniform->set(modelViewProjectionMatrix);
And in the updateSlaveImplementatiuon I see:
   _camera->setProjectionMatrix(view.getCamera()->getProjectionMatrix()
* _projectionOffset);
So where is my mistake? It should be obvious but it seems I'm blind here.
Many thanks
- Werner -
I'm experimenting with slave cameras for a while now and now I'm totally
stuck.
I'm doing a tiled display of a scene and for the main scene graph it
works fine with projection offset matrix on the slave cameras
and all cameras having a RELATIVE reference frame.
But my scene also has cameras with ABSOLUTE reference frame (i.e. a
background image).
The background is - of course - fully mapped on each tile.
In order to solve this I modified my vertex shader like that:
  Â
gl_Position=osg_ModelViewProjectionMatrix*projectionOffsetMatrix*osg_Vertex;
and I populate the projection offset matrix via uniform (same as slave
offset matrix). Unfortunately without the expected success.
For creation of osg_ModelViewPrtojectionMatrix I found this code:
   osg::Matrixd modelViewProjectionMatrix = modelMatrix * viewMatrix *
_camera->getProjectionMatrix();
   uniform->set(modelViewProjectionMatrix);
And in the updateSlaveImplementatiuon I see:
   _camera->setProjectionMatrix(view.getCamera()->getProjectionMatrix()
* _projectionOffset);
So where is my mistake? It should be obvious but it seems I'm blind here.
Many thanks
- Werner -