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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

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:
    305
    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:
    305
    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!