Problems with RTT

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Hanmac
Gnoblar
Posts: 13
Joined: Wed May 25, 2011 12:41 pm
x 4

Problems with RTT

Post by Hanmac »

Hay i tryed to implment some kind of RTT. currently i use DefaultSceneManager
i wanted two scenes:
scene1:
  • attached camera1
  • childnode1
    • attached plane
  • childnode2
    • attached cube (with RTTscene-material)
scene2:
  • attached camera2
  • childnode 3
    • attached sphere
so i want that only scene2 is shown in the cube-material ...

currently the cube itself is shown in the sides of the cube

can someone help me with this problem?
You do not have the required permissions to view the files attached to this post.
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 217

Re: Problems with RTT

Post by scrawl »

I would use visibility flags to show only the elements you want in each scene.

For example:

Code: Select all

int scene1 = 2;
int scene2 = 4;

cubeEntity->setVisibilityFlags(scene1);
planeEntity->setVisibilityFlags(scene1);
sphereEntity->setVisibilityFlags(scene2);

// Or if you want to show an object in both scenes
entity->setVisibilityFlags(scene1 + scene2);
then use setVisibilityMask(scene1) for the main viewport, and setVisibilityMask(scene2) for the RTT viewport.

Another way would be to use a render target listener to hide the cube immediately before the RTT is drawn, and show it again afterwards.

Or you could use two separate scene managers, but that's probably overkill.
Hanmac
Gnoblar
Posts: 13
Joined: Wed May 25, 2011 12:41 pm
x 4

Re: Problems with RTT

Post by Hanmac »

thanks, visibility flags solved it for me, only bad that SceneNode has no visibility flags too, so you could define it per-sub-tree