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. Dismiss Notice

Question Refraction Shader - Built In RP - Single Pass Instanced VR - possible?

Discussion in 'Shaders' started by Kareeem, Jun 5, 2023.

  1. Kareeem

    Kareeem

    Joined:
    Mar 1, 2013
    Posts:
    37
    Hey dear Unity community,

    I am looking for a refraction shader that works in Built In render pipeline and in Single Pass Instanced VR.
    Its important that the shader does not only work with distortion textures but rather with an IOR so I can use it for glass and liquids.

    Any ideas? I cant seem to get something working with Amplify SHader Editor and am also not able to find anything on the web.

    Any help would be much appreciated, Thank you!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,221
    Doesn't exist, because all non-raytraced refractions are just using distortion. Any shader that uses "IOR" is using it as an input to adjust distortion.
     
  3. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,026
    could this be faked by having a different distortion for each face normal on a shape?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,221
    That’s how you always do it.
     
  5. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,026
    I've been unable to get any thing other than one distortion setting to work at a time. Regardless of whatever distortion values I put on different faces or different objects, only one setting seems to ever act as a global for all distortions.
     
  6. Kareeem

    Kareeem

    Joined:
    Mar 1, 2013
    Posts:
    37
    thanks for your replies. we switched to URP for refractions.