Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Reflection Probe in Amplify Shader

Discussion in 'Shaders' started by Unique-Player, Jun 19, 2020.

  1. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    74
    I am trying to get reflection probe data through custom function in Amplify Shader.
    Custom function code is following
    Code (CSharp):
    1. float4 skyData = UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, worldReflection);
    2. float3 skyColor = DecodeHDR (skyData, unity_SpecCube0_HDR);
    3. return skyColor;
    worldReflection is calculated by amplify shader itself.

    The problem is i am getting black and white data of the reflection, can anybody say what i am doing wrong?
    Thanks.
     
  2. Unique-Player

    Unique-Player

    Joined:
    May 6, 2017
    Posts:
    74
    Question solved. I forgot to select output type to be float3.
     
    a_d_69 likes this.
  3. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    148
    Hi, I tried using your example but it didn't work. Is his supposed to give me the Unity's environment reflection texture so I can use it in ASE?

    I did it like in this screenshot

    Screenshot 2022-04-12 192029.png