[osg-users] FBO question

2014-07-21 Thread Trajce Nikolov NICK
Hi Community,

if I set my camera to RTT into FBO, will the Camera Read/Write buffers
points to this FBO?

Thanks a bunch!

Nick

-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FBO question

2014-07-21 Thread Robert Osfield
On 21 July 2014 19:11, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com
wrote:

 if I set my camera to RTT into FBO, will the Camera Read/Write buffers
 points to this FBO?


Yes.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FBO question

2007-09-17 Thread John Donovan
Igor Naigovzin wrote:
 Hello to all!
 I have a simple question.
 I want to render a two cameras (two different render surfaces) by exactly
 the same scene.

Hi Igor,
if I understand you correctly, you're doing the same sort of thing I am. I have
a few cameras rendering to the same texture.
This is the code I use:
ref_ptrGraphicsContext::Traits traits = new GraphicsContext::Traits;
traits-x = 500;
traits-y = 800;
traits-width = totalWidth;
traits-height = vpHeight;
traits-windowDecoration = true;
traits-doubleBuffer = true;
traits-sharedContext = 0;
ref_ptrGraphicsContext _gc =
GraphicsContext::createGraphicsContext(traits.get());

osgViewer::Viewer _viewer;

for (int i = 0; i  _numCameras; ++i) {
   rot.makeRotate(_startAng + (_angStep * i), 0.0, 1.0, 0.0);
   ref_ptrCamera cam = new Camera;
   cam-setViewport(new Viewport(_cameraWidth * i, 0.0, _cameraWidth,
_totalHeight));
   cam-setRenderOrder(osg::Camera::PRE_RENDER);
   cam-setGraphicsContext(_gc);
   cam-setAllowEventFocus(false);
   cam-setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);
   cam-attach(Camera::COLOR_BUFFER, _texture.get());
   cam-setDataVariance(Object::DYNAMIC);
   cam-addChild(group.get());

   _viewer.addSlave(cam.get(), Matrixd(), rot, false);
}

_viewer.getCamera()-setProjectionMatrixAsPerspective(_cameraFoVX /
_aspectRatio, _aspectRatio, 1.0, 1000.0);
_viewer.getCamera()-setViewMatrix(trans);
_viewer.getCamera()-setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
_viewer.getCamera()-setClearColor(Vec4(FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX));
_viewer.setDataVariance(Object::DYNAMIC);

I'm using a floating-point texture, but it works just as well with a regular
8-bit RGB texture. Note I'm setting up the viewports for each camera. My
application is a piecewise linear approximation of a cylindrical projection.
I then set up another viewer and another scene graph to render the textured
quad to the screen, then call _both_ viewers in my render loop.

Hope this helps,
-J



__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] FBO question

2007-09-16 Thread Igor Naigovzin
Hello to all!
I have a simple question.
I want to render a two cameras (two different render surfaces) by exactly
the same scene.
But the two cameras are with different sizes.
I.e. the two cameras has to show me the same picture, but not the same size.
1. I'm using CameraNode and frame buffer object in order to render the scene
to the texture.
2***. I use the same texture for two cameras.
3. If I use RenderImplementationTarget as image then everything is OK.
But if I use RenderImplementationTarget as texture then only one camera
shows me the texture.

Is there any way to use the same texture rendered to frame buffer object for
the two cameras without copying it?
Or maybe there is another way to do this purpose?

Thank you a lot!

*** This is how I am doing it:

  root
   / \
  /   \
   CameraNodepolygon
   |
   |
   scene

CameraNode has a mask (only main camera traverses the CameraNode)
Both cameras render the polygon with the prerenderred (by frame buffer
object) texture.


===
  Igor Naigovzin
  Technion - CS and Biology Student
  Rafael - Software Developer
  email: [EMAIL PROTECTED]
===
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org