Search Unity

Difference between shadergraph's Sample Texture 2D array and UNITY_SAMPLE_TEX2DARRAY

Discussion in 'Shaders' started by Shuyin76, Aug 7, 2020.

  1. Shuyin76

    Shuyin76

    Joined:
    Aug 1, 2014
    Posts:
    5
    Hello there !
    I'm trying to update my old shader using a texture array to the new URP using shader graphs.
    The thing is, i'm a total stranger when it's about shader scripts and shader graph.
    What i undertand is UNITY_SAMPLE_TEX2DARRAY takes the texture array and a vecto3 in to return a color and the Shader graph sampler asks for a vector2 and an index instead.
    My question is, are they the same parameters between the two functions (with the vector3 being separated in a Vector2 and an index) or is the use of these functions are completely different ?

    I hope you can help me better understand what i'm doing ! :)

    Clément.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    Hi!
    Yes, they should be the same.
     
    Shuyin76 likes this.