Which compositor pass handles which PlanarReflectionActor?

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


jwwalker
Goblin
Posts: 267
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 19

Which compositor pass handles which PlanarReflectionActor?

Post by jwwalker »

If I install compositor workspace listeners on the workspaces used for planar reflections, is there any way for the listener to tell which mirror is being handled by a particular scene pass?

If you wonder why I would want to do such a thing... I'm working on a program in which a camera may have a corresponding "fill light", a non-shadow-casting point light at the same location as the camera. Now, suppose the camera sees a person looking into a mirror. If this was being rendered by ray-tracing, then the fill light could bounce off the mirror, illuminate the mirror-facing side of the person, and then bounce back off the mirror toward the camera. To approximate that effect, when rendering the image for the mirror, I want to put the fill light at the mirrored position rather than its real-world position.

jwwalker
Goblin
Posts: 267
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 19

Re: Which compositor pass handles which PlanarReflectionActor?

Post by jwwalker »

I think I’ve figured out how to get enough information from the Camera and the SceneManager.

jwwalker
Goblin
Posts: 267
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 19

Re: Which compositor pass handles which PlanarReflectionActor?

Post by jwwalker »

I ended up adding code to PlanarReflections::update,

Code: Select all

                    Ogre::UserObjectBindings &cameraBindings(
                        static_cast<MovableObject *>( actorData->reflectionCamera )
                            ->getUserObjectBindings() );
                    cameraBindings.setUserAny( "Slot", Any( actor->mCurrentBoundSlot ) );

where other properties of reflectionCamera are set.