Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How to Make the Camera to Cull According to a Oblique Matrix?

Discussion in 'General Graphics' started by AhSai, Jun 24, 2020.

  1. AhSai

    AhSai

    Joined:
    Jun 25, 2017
    Posts:
    129
    I am making a reflection camera that is used for a flat water surface. I have successfully made the camera to render objects that are only above the water surface with:
    Code (CSharp):
    1. camera.CalculateObliqueMatrix()
    However, although objects that are under the water surface are not being rendered, they are still issuing draw calls when they are within the camera's frustum. I tried to set:
    Code (CSharp):
    1. camera.cullingMatrix = obliqueMatrix * camera.worldToCameraMatrix;
    but this doesn't work. How do you make the camera to calculate rather or not to issue draw call according to the new obliqueMatrix?
     
  2. TomGoethals

    TomGoethals

    Joined:
    Jan 29, 2022
    Posts:
    40