Hi, Robert,
Thanks for the reaffirmation. I finally figured out what happened with my
application. It loads an OpenFlight model as the main scene, in which two faces
will use textures rendered by cameras. The two faces originally use an
identical dummy texture as place holder. It turned out that the osg optimizer
merged the second face with the first one into a single drawable. So when the
first face's texture was replaced, so was the second, with the same texture.
The debug print out actually reported this, but I saw both faces' textures were
replaced and assumed they were independently replaced with different ones.
After changing the model so that the two faces used different dummy textures,
the osg optimizer stopping combining the two faces into the same drawable, and
I was able to see two different textures on the model.
Regards,
Yefei
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert Osfield
Sent: Wednesday, September 14, 2011 3:16 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Two Cameras, Two Render Targets?
Hi Yefei,
The OSG supports multiple render to texture Cameras seamlessly, it should
simply be a case of creating the Camera's and adding the textures and
appropriate subgraphs to them and then using these textures. The only twist
would be that if you are using Viewer slave Camera then you'll need to make
sure that these slaves don't inherit the main scene graph as is the default
behavior of slave Camera. A render to texture Camera in the scene graph
doesn't inherit any subgraph so it'll just use what subgraph you assign to it.
Robert.
On Wed, Sep 14, 2011 at 1:01 AM, He, Yefei <[email protected]> wrote:
> Hello, Folks,
>
>
>
> I’m working on an OSG application that requires two cameras rendering
> two different subscenes into textures, and apply the two textures to
> different geometries in the main scene. I started out with the
> osgprerender example by creating two cameras and attaching them to two
> different textures. But the result was the two textures were
> identical, and the content was that from the first camera. I saw that
> Anthousis Andreadis reported a similar problem in April and later
> submitted a fix. My version of OSG does contain that fix. I looked
> into osgstereomatch and osgmultiplerendertargets, but I figured they
> are a bit different from my application. In those applications, a
> single camera is attached to multiple textures; in my case, two
> cameras are attached to two different textures. What do I need to do to make
> my application work? Are there any examples that I can look at?
>
>
>
> Thanks,
>
>
>
> Yefei
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org