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.

78 lines
4.7 KiB

  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "ASESampleShaders/TextureArray"
  4. {
  5. Properties
  6. {
  7. [HideInInspector] __dirty( "", Int ) = 1
  8. _TextureArrayAlbedo("Texture Array Albedo", 2DArray ) = "" {}
  9. _TextureArrayNormal("Texture Array Normal", 2DArray ) = "" {}
  10. _NormalScale("Normal Scale", Float) = 1
  11. _RoughScale("Rough Scale", Range( 0 , 1)) = 0.1
  12. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  13. }
  14. SubShader
  15. {
  16. Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" }
  17. Cull Back
  18. CGPROGRAM
  19. #include "UnityStandardUtils.cginc"
  20. #pragma target 3.5
  21. #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows
  22. struct Input
  23. {
  24. float2 uv_texcoord;
  25. };
  26. uniform UNITY_DECLARE_TEX2DARRAY( _TextureArrayNormal );
  27. uniform float4 _TextureArrayNormal_ST;
  28. uniform float _NormalScale;
  29. uniform UNITY_DECLARE_TEX2DARRAY( _TextureArrayAlbedo );
  30. uniform float4 _TextureArrayAlbedo_ST;
  31. uniform float _RoughScale;
  32. void surf( Input i , inout SurfaceOutputStandardSpecular o )
  33. {
  34. float2 uv_TextureArrayNormal = i.uv_texcoord * _TextureArrayNormal_ST.xy + _TextureArrayNormal_ST.zw;
  35. o.Normal = UnpackScaleNormal( UNITY_SAMPLE_TEX2DARRAY(_TextureArrayNormal, float3(uv_TextureArrayNormal, 0.0) ) ,_NormalScale );
  36. float2 uv_TextureArrayAlbedo = i.uv_texcoord * _TextureArrayAlbedo_ST.xy + _TextureArrayAlbedo_ST.zw;
  37. o.Albedo = UNITY_SAMPLE_TEX2DARRAY(_TextureArrayAlbedo, float3(uv_TextureArrayAlbedo, 3.0) ).xyz;
  38. o.Smoothness = ( UNITY_SAMPLE_TEX2DARRAY(_TextureArrayAlbedo, float3(uv_TextureArrayAlbedo, 0.0) ).x * _RoughScale );
  39. o.Occlusion = UNITY_SAMPLE_TEX2DARRAY(_TextureArrayAlbedo, float3(uv_TextureArrayAlbedo, 1.0) ).x;
  40. o.Alpha = 1;
  41. }
  42. ENDCG
  43. }
  44. Fallback "Diffuse"
  45. CustomEditor "ASEMaterialInspector"
  46. }
  47. /*ASEBEGIN
  48. Version=5106
  49. 351;364;1130;669;1124.783;702.0178;1.84876;True;False
  50. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;407.6068,-183.0747;Float;False;True;3;Float;ASEMaterialInspector;StandardSpecular;ASESampleShaders/TextureArray;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;0;False;0;0;Opaque;0.5;True;True;0;False;Opaque;Geometry;All;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;False;0;255;255;0;0;0;0;False;0;4;10;25;False;0.5;True;0;Zero;Zero;0;Zero;Zero;Add;Add;0;False;0;0,0,0,0;VertexOffset;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT;0.0;False;5;FLOAT;0.0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0.0;False;9;FLOAT;0.0;False;10;OBJECT;0;False;11;FLOAT3;0.0,0,0;False;12;FLOAT3;0.0,0,0;False;13;OBJECT;0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False
  51. Node;AmplifyShaderEditor.TextureArrayNode;105;-310.502,63.60038;Float;True;Property;_TextureArray2;Texture Array 2;1;0;None;0;Instance;108;Auto;False;0;FLOAT2;0,0;False;1;FLOAT;0.0;False;2;FLOAT;0.0;False;3;FLOAT;1.0;False
  52. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;117;99.54906,25.52966;Float;False;0;FLOAT;0.0;False;1;FLOAT;0.0;False
  53. Node;AmplifyShaderEditor.RangedFloatNode;113;-553.9034,-373.3005;Float;False;Constant;_AlbedoIndex;Albedo Index;1;0;3;0;0
  54. Node;AmplifyShaderEditor.RangedFloatNode;110;-544,320;Float;False;Constant;_OcclusionIndex;Occlusion Index;1;0;1;0;0
  55. Node;AmplifyShaderEditor.RangedFloatNode;111;-560,-176;Float;False;Constant;_NormalIndex;Normal Index;1;0;0;0;0
  56. Node;AmplifyShaderEditor.RangedFloatNode;123;-560,-80;Float;False;Property;_NormalScale;Normal Scale;2;0;1;0;0
  57. Node;AmplifyShaderEditor.TextureArrayNode;103;-304,-192;Float;True;Property;_TextureArrayNormal;Texture Array Normal;1;0;None;0;Object;-1;Auto;True;0;FLOAT2;0,0;False;1;FLOAT;0.0;False;2;FLOAT;0.0;False;3;FLOAT;1.0;False
  58. Node;AmplifyShaderEditor.TextureArrayNode;108;-306.7961,-432.2489;Float;True;Property;_TextureArrayAlbedo;Texture Array Albedo;0;0;None;0;Object;-1;Auto;False;0;FLOAT2;0,0;False;1;FLOAT;0.0;False;2;FLOAT;0.0;False;3;FLOAT;1.0;False
  59. Node;AmplifyShaderEditor.RangedFloatNode;118;-304,240;Float;False;Property;_RoughScale;Rough Scale;3;0;0.1;0;1
  60. Node;AmplifyShaderEditor.TextureArrayNode;104;-320,320;Float;True;Property;_TextureArray3;Texture Array 3;1;0;None;0;Instance;108;Auto;False;0;FLOAT2;0,0;False;1;FLOAT;0.0;False;2;FLOAT;0.0;False;3;FLOAT;1.0;False
  61. Node;AmplifyShaderEditor.RangedFloatNode;109;-560,64;Float;False;Constant;_RoughnessIndex;Roughness Index;1;0;0;0;0
  62. WireConnection;0;0;108;0
  63. WireConnection;0;1;103;0
  64. WireConnection;0;4;117;0
  65. WireConnection;0;5;104;1
  66. WireConnection;105;1;109;0
  67. WireConnection;117;0;105;1
  68. WireConnection;117;1;118;0
  69. WireConnection;103;1;111;0
  70. WireConnection;103;3;123;0
  71. WireConnection;108;1;113;0
  72. WireConnection;104;1;110;0
  73. ASEEND*/
  74. //CHKSM=2F4BD82319337791A38FEF962468BF4A3E96D093