Search Unity

Reflection techniques [Solved]

Discussion in 'General Graphics' started by Kazeon, May 29, 2018.

  1. Kazeon

    Kazeon

    Joined:
    May 22, 2017
    Posts:
    41
    Hello, in my survival game I use the standard water4advanced asset, and I have some problems regarding to the reflection.

    You know it uses RenderTexture to get the reflection working. But the problem is, my scene is quite complex, so rendering the helper camera will be very costy. When I enable the reflection, the frame rate drops from ~35 to ~25. And other problem is, I need multiple water objects at different heights for rivers as well. It means it has to render the helper camera multiple times for each water at each different height, which would worsen the performance even more. So is there better reflection "techniques" to solve this problem that works with multiple water level? If there is then what is it?

    This is a pic showing how complex the scene is:
    scene.jpg

    I also have tried using simple reflective plane and reflection probe (the water surface uses different shader) but it also has issues: https://answers.unity.com/questions/1422906/a-water-reflection-problem.html

    I have other problem with the reflection but it's rather minor. I hope to fix this first before going into it.

    Any help will be greatly appreciated! Thanks in advance! :D

    Regards,
     
  2. Kazeon

    Kazeon

    Joined:
    May 22, 2017
    Posts:
    41
    Problem solved! Eventually I keep using RenderTexture. The reflection was so heavy because the reflection distance (helper camera's clipping far) is limitless, so everything got re-rendered. And modifying the clipping plane is not possible. So the solution is to use this line:
    reflectCamera.layerCullDistances = distances
    . You probably want to google it for more information on how to use it.