Rendering an entity twice

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
l99057j
Gnoblar
Posts: 14
Joined: Wed Aug 28, 2013 1:19 pm

Rendering an entity twice

Post by l99057j »

For certain objects in my scene (let's call them foo objects), I want to render them more than once with different material settings. More accurately, I want to render all the back-facing geometry for foo objects then render all of the non-foo objects in my scene. Only after that is finished, will I come back and render the front faces of my foo objects.

I've been reading and can see that I have some control over the order of rendering with render groups. But I'm not sure how I can tell Ogre to render the same objects again with different settings. If I needed it back to back I know I could use passes in the material but when there is work to be done in between what is the proper mechanism?
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: Rendering an entity twice

Post by scrawl »

Have a look at the compositor system. Using render_scene compositor pass and material schemes, you can render objects in specific render queues with a specific material technique.
l99057j
Gnoblar
Posts: 14
Joined: Wed Aug 28, 2013 1:19 pm

Re: Rendering an entity twice

Post by l99057j »

Thank you for your reply. I read the chapter in the manual about compositors and it sounds like it might fit the bill. I don't see, though, how I tell my objects which 'version' they should render. For example, if I use two render_scene compositor passes, when Ogre renders my scene objects do they somehow have the ability to know "I'm in the second compositor pass" and use an appropriate material for that pass?
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: Rendering an entity twice

Post by scrawl »

Use material_scheme in compositor: http://www.ogre3d.org/docs/manual/manua ... 005fscheme
e.g. material_scheme type1

Then create your materials like this:

Code: Select all

material foobar
{
   technique
   {
      scheme type1
      pass
      {
         ...........
      }
   }
   technique
   {
      scheme type2
      pass
      {
         ...........
      }
   }
}

l99057j
Gnoblar
Posts: 14
Joined: Wed Aug 28, 2013 1:19 pm

Re: Rendering an entity twice

Post by l99057j »

Ok, I see how it fits together now. Thanks very much, scrawl, looking forward to trying this out!
Post Reply