0

Ogre 1.8.1 overlays render after compositor. For example: for compositor "Grayscale" overlays are still colored. Is any way to apply compositor for all overlays in scene? For some overlays only?

fpohtmeh
  • 506
  • 4
  • 15

2 Answers2

1

I've found a solution. Use these steps:

  1. Detect compositor's viewport.
  2. Call setOverlaysEnabled(true)
  3. Hide all overlays when compositor is working. Otherwise, they will overlap compositor's result.
  4. Restore all overlays before compositor rendering. Use render target listener's for 3 and 4.
fpohtmeh
  • 506
  • 4
  • 15
-1

By default Ogre's overlays are set to the render queue 100 (RENDER_QUEUE_OVERLAY). However by default Ogre's compositor (more specifically the render_scene pass) only includes the render queues up to 95 (RENDER_QUEUE_SKIES_LATE).

So in order to ensure that your overlays are included in the compositor, you need to tell your compositor to include all objects = everything up to the last render queue which is 105 (RENDER_QUEUE_MAX).

So try using the following snippet in your compositor script to get the scene contents to be used as input for your compositor shader materials:

pass render_scene  // render everything including overlays
{
    first_render_queue 0
    last_render_queue 105
}
Philip Allgaier
  • 3,505
  • 2
  • 26
  • 53
  • I tried this way, but it doesn't work. Did you see a working result or it is a theory only? – fpohtmeh Feb 27 '15 at 10:00
  • 1
    @fpohtmeh So far, theory only (based on looking at Ogre's code). When I find the time I will try to test it and have another look at Ogre's source code again. – Philip Allgaier Feb 28 '15 at 10:08