Search Unity

Question How to achieve reflections with a second orthographic camera?

Discussion in 'General Graphics' started by dccoo, Oct 14, 2022.

  1. dccoo

    dccoo

    Joined:
    Oct 3, 2015
    Posts:
    161
    I'm making a top-down 3D game with an orthographic camera. The main camera can move and rotate in the y axis.

    I would like to make the water reflect (acting like a mirror for the viewer). For that I'm using a second orthographic camera with the same orthographic size than the original, but with the inverted rotation in x, so it looks to the direction of the main camera after it is reflected in the water plane.

    How can I make this work? I'm having all sorts of trouble... some things under the water appear in the reflection render texture, everything looks buggy when the main camera rotates in y, etc.

    I can't make the second camera reflect only what is over the water and react well to the movements of the main camera... any tips on that?