Search Unity

Question Planar reflection probe

Discussion in 'High Definition Render Pipeline' started by Phantom_X, Mar 10, 2020.

  1. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    How do you use the Planar reflection probe in a shader?
    I want to use this in a water shader to make reflections, but can't find how to sample it. Can't assign it to a Cubemap input either.

    It's working out of the box with regular shaders, but for a water surface it can't be like that. I just want to sample the reflection texture and do my own things with it.
     
  2. spiegelball

    spiegelball

    Joined:
    Mar 2, 2020
    Posts:
    16
    If your object is influenced by the reflection probe, a shader with a reflective component should sample from it automatically. Roughness value of the material may not be taken into account. If your base is a PBR shader (HDRP Lit for example), you can go with Metallic = 1, Smoothness = 0 and create distortions, ripples etc. via a normal map (possibly animated). For more advanced effects (or sampling from the reflection probe) you'd probably have to write the reflection probe result to a Render Texture and sample from that in the shader.
     
  3. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Yes I am using Standard lit shader and I see the reflection by default, however it's not doing what I want. So where would I get the result from the reflection probe? can you get this by C# ?

    thanks!