You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
594 B

  1. Shader "Hidden/TextureArrayEditor"
  2. {
  3. Properties
  4. {
  5. _MainTex ("_MainTex", 2DArray) = "white" {}
  6. _Index ("_Index", Int) = 0
  7. }
  8. SubShader
  9. {
  10. Pass
  11. {
  12. CGPROGRAM
  13. #pragma vertex vert_img
  14. #pragma fragment frag
  15. #pragma target 3.5
  16. #include "UnityCG.cginc"
  17. #include "UnityStandardUtils.cginc"
  18. uniform UNITY_DECLARE_TEX2DARRAY( _MainTex );
  19. int _Index;
  20. float4 frag( v2f_img i ) : SV_Target
  21. {
  22. //return UNITY_SAMPLE_TEX2DARRAY_LOD( _MainTex, float3( i.uv, _Index), 0 );
  23. return UNITY_SAMPLE_TEX2DARRAY( _MainTex, float3( i.uv, _Index) );
  24. }
  25. ENDCG
  26. }
  27. }
  28. }