Initialize SimpleWaterProcessor second viewport?

I have a Default ViewPort and a Compass Viewport.

Default Viewport is not restricted in view and loads first.

Compass ViewPort is restricted to top down view with rotation around the X plane.

When using multiple ViewPorts and you have a SimpleWaterProcessor, the reflection scene will rotate based off the ViewPort angels SimpleWaterProcessor is added to. In this case the Default ViewPort with unlimited rotation.

Using the initialize method in SimpleWaterProcessor to set different ViewPorts just overrides the Default ViewPort and results in the Default ViewPort going black( default color) and just adding the same SimpleWaterProcessor to the Compass Viewport just reverses the process to where the Compass goes black. i.e Expected behavior.

Duplicating the SimpleWaterProcessor and adding it to the Compass ViewPort has the effect of displaying the Compass View in both ViewPorts since all you are doing is overlaying geometries. i.e. expected behavior, whatever ViewPort was last added will be the view you see.

What is the proper way to initialize SimpleWaterProcessor to also render to the Compass ViewPort so the Compass ViewPort uses its angles for rendering rather than Default ViewPort angles?

The answer is:

Create seperate SimpleWaterProcessors for each ViewPort.
Set the plane of the second SimpleWaterProcessor by cloning the first SimpleWaterProcesssors plane.
Set the geometry of the second SimpleWaterProcessor by cloning the first SimpleWaterProcessors geometry.
Set the material of each geometry using each of the SimpleWaterProcessors material respectively.
Attach the first SimpleWaterProcessor geometry to a node that is not in the second ViewPorts attached scene.
Attach the second SimpleWaterProcessor geometry to a node that is in the second ViewPorts attached scene.

2 Likes