How to write a SceneProcessor

I am trying to write my own water SceneProcessor, since it’s not like the built-in one. What it does is this:

  1. Render a different scene from the main one (probably after) that only has water meshes in it
  2. With the color and depth textures from both the main and water scenes (so 4 textures total), render a full-screen Picture with all these combined. I might have an additional texture with water normals to do image-based refraction if I can.
    The first problem I’m running into is that I cannot get the rendered textures from the main scene. If I use viewPort.getOutputFrameBuffer().getColorBuffer().getTexture() to pass it into the shader, it returns a NullPointerException.
    I assumed it was because there was no output frame buffer set for the main viewport, so I set a framebuffer (with a color and depth texture set into it) to viewPort when initializing the program. And then in the water scene processor, I took the texture of the main viewport with a copied version of viewPort.getOutputFrameBuffer() (with renderer.copyFrameBuffer(), since I don’t think you can read and write to the same texture at once (which I learned while writing an HDR scene processor).
    But if I set a framebuffer to the main viewport which I did above, I get a black screen.
    Anyway, how do I get the main scene as a texture for a scene processor?

Hm did you take alook, how the water processors that already exist do this? Since they get the depth of the mainscene there must be a way to get access to the framebuffer.