Re: [osg-users] Cannot resize when rendering to FBO

2013-08-03 Thread Terry Welsh
Thanks Farshid. Camera::setRenderingCache() is the secret sauce. It
works perfectly now. I hadn't come across that function yet, so I
don't know if I ever would have found it.
--
Terry Welsh
www.reallyslick.com


>
> Hi Terry,
>
> I use osg::Camera objects to render FBOs that are the same size as the
> window. When the window is resized, I clear the rendering cache of the
> camera and reset the texture size:
>
> texture->setTextureSize(w,h);
> texture->dirtyTextureObject();
> camera->setRenderingCache(0);
>
> This has worked fine for me for a while now. What version of OSG are you
> using?
>
> Cheers,
> Farshid
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cannot resize when rendering to FBO

2013-08-02 Thread Farshid Lashkari
Hi Terry,

I use osg::Camera objects to render FBOs that are the same size as the
window. When the window is resized, I clear the rendering cache of the
camera and reset the texture size:

texture->setTextureSize(w,h);
texture->dirtyTextureObject();
camera->setRenderingCache(0);

This has worked fine for me for a while now. What version of OSG are you
using?

Cheers,
Farshid



On Fri, Aug 2, 2013 at 3:51 PM, Terry Welsh  wrote:

> I render to an FBO texture attachment the same size as my window. But
> when I expand the window and try to resize the texture to match it, I
> end up rendering to a rectangle the size of my original window in the
> lower left corner of the now-larger texture. It seems like a lot of
> people would have tried this by now. Any advice from someone who is
> doing it successfully?
>
> I have tried this code that has been recommended in a few emails, but no
> luck.
>
> mColorTex->setTextureSize(w, h);
> mColorTex->dirtyTextureObject();
> mColorTex->dirtyTextureParameters();
>
> mCamera->setViewport(x, y, w, h);
> mCompositeCamera->setViewport(x, y, w, h);
>
> mMainSceneView->getRenderStage()->setFrameBufferObject(NULL);
> mMainSceneView->getRenderStage()->setCameraRequiresSetUp(true);
>
> This seems to be the exact same problem as this unanswered email from
> last year. There have been similar threads from time to time as well.
>
> http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2012-March/057126.html
> --
> Terry Welsh
> www.reallyslick.com
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Cannot resize when rendering to FBO

2013-08-02 Thread Terry Welsh
I render to an FBO texture attachment the same size as my window. But
when I expand the window and try to resize the texture to match it, I
end up rendering to a rectangle the size of my original window in the
lower left corner of the now-larger texture. It seems like a lot of
people would have tried this by now. Any advice from someone who is
doing it successfully?

I have tried this code that has been recommended in a few emails, but no luck.

mColorTex->setTextureSize(w, h);
mColorTex->dirtyTextureObject();
mColorTex->dirtyTextureParameters();

mCamera->setViewport(x, y, w, h);
mCompositeCamera->setViewport(x, y, w, h);

mMainSceneView->getRenderStage()->setFrameBufferObject(NULL);
mMainSceneView->getRenderStage()->setCameraRequiresSetUp(true);

This seems to be the exact same problem as this unanswered email from
last year. There have been similar threads from time to time as well.
http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2012-March/057126.html
--
Terry Welsh
www.reallyslick.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org