Search Unity

Refraction Shader Issue

Discussion in 'General Graphics' started by FelipeFormoso, Jun 26, 2021.

  1. FelipeFormoso

    FelipeFormoso

    Joined:
    May 31, 2021
    Posts:
    4
    Hello! I'm new to Unity and HDRP. I was wondering if there is way of looking at transparent objects through refractive objects. Here is an example of the issue im having, you can see that the cube gets refracted but the other chess pieces dont.
    Thank you!!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Yes!

    But actually No.

    HDRP's refractive materials will only show opaque objects visible through them. They use the camera opaque texture (so named because it's a copy of what the camera renders after all opaque objects and the sky has rendered but before any transparent objects have rendered) and falls back to reflection probes when trying to refract outside of the screen view. Since an object has to be transparent to be refractive, they won't show up in the opaque texture so you can't see another refractive, or any other transparent objects, through a refractive surface.


    The "Yes!" is you can make this work by enabling ray tracing and recursive rendering. But that requires a recent, high end Nvidia GPU to be plausibly useful.
     
    FelipeFormoso likes this.
  3. FelipeFormoso

    FelipeFormoso

    Joined:
    May 31, 2021
    Posts:
    4
    ohh thats a bummer haha Thank you very much!