MrRoomvray 1.shader 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "Unlit/MrRoomnormal"
  4. {
  5. Properties
  6. {
  7. _TextureAb("TextureAb", 2D) = "white" {}
  8. _TextureLight("TextureLight", 2D) = "white" {}
  9. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  10. [HideInInspector] _texcoord2( "", 2D ) = "white" {}
  11. }
  12. SubShader
  13. {
  14. Tags { "RenderType"="Opaque" }
  15. LOD 100
  16. CGINCLUDE
  17. #pragma target 3.0
  18. ENDCG
  19. Blend Off
  20. Cull Back
  21. ColorMask RGBA
  22. ZWrite On
  23. ZTest LEqual
  24. Offset 0 , 0
  25. Pass
  26. {
  27. Name "Unlit"
  28. Tags { "LightMode"="ForwardBase" }
  29. CGPROGRAM
  30. #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
  31. //only defining to not throw compilation error over Unity 5.5
  32. #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
  33. #endif
  34. #pragma vertex vert
  35. #pragma fragment frag
  36. #pragma multi_compile_instancing
  37. #include "UnityCG.cginc"
  38. struct appdata
  39. {
  40. float4 vertex : POSITION;
  41. float4 color : COLOR;
  42. UNITY_VERTEX_INPUT_INSTANCE_ID
  43. float4 ase_texcoord : TEXCOORD0;
  44. float4 ase_texcoord1 : TEXCOORD1;
  45. };
  46. struct v2f
  47. {
  48. float4 vertex : SV_POSITION;
  49. UNITY_VERTEX_INPUT_INSTANCE_ID
  50. UNITY_VERTEX_OUTPUT_STEREO
  51. float4 ase_texcoord : TEXCOORD0;
  52. };
  53. uniform sampler2D _TextureAb;
  54. uniform float4 _TextureAb_ST;
  55. uniform sampler2D _TextureLight;
  56. uniform float4 _TextureLight_ST;
  57. v2f vert ( appdata v )
  58. {
  59. v2f o;
  60. UNITY_SETUP_INSTANCE_ID(v);
  61. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  62. UNITY_TRANSFER_INSTANCE_ID(v, o);
  63. o.ase_texcoord.xy = v.ase_texcoord.xy;
  64. o.ase_texcoord.zw = v.ase_texcoord1.xy;
  65. float3 vertexValue = float3(0, 0, 0);
  66. #if ASE_ABSOLUTE_VERTEX_POS
  67. vertexValue = v.vertex.xyz;
  68. #endif
  69. vertexValue = vertexValue;
  70. #if ASE_ABSOLUTE_VERTEX_POS
  71. v.vertex.xyz = vertexValue;
  72. #else
  73. v.vertex.xyz += vertexValue;
  74. #endif
  75. o.vertex = UnityObjectToClipPos(v.vertex);
  76. return o;
  77. }
  78. fixed4 frag (v2f i ) : SV_Target
  79. {
  80. UNITY_SETUP_INSTANCE_ID(i);
  81. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
  82. fixed4 finalColor;
  83. float2 uv_TextureAb = i.ase_texcoord.xy * _TextureAb_ST.xy + _TextureAb_ST.zw;
  84. float2 uv2_TextureLight = i.ase_texcoord.zw * _TextureLight_ST.xy + _TextureLight_ST.zw;
  85. finalColor = ( tex2D( _TextureAb, uv_TextureAb ) * tex2D( _TextureLight, uv2_TextureLight ) );
  86. return finalColor;
  87. }
  88. ENDCG
  89. }
  90. }
  91. CustomEditor "ASEMaterialInspector"
  92. }
  93. /*ASEBEGIN
  94. Version=17101
  95. -1644;253;1662;880;1313.064;452.7492;1;True;False
  96. Node;AmplifyShaderEditor.SamplerNode;6;-893.9515,-269.7101;Inherit;True;Property;_TextureAb;TextureAb;1;0;Create;True;0;0;False;0;None;71f4e1fecdd2690489c39bc67bfb627f;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  97. Node;AmplifyShaderEditor.SamplerNode;7;-836.9479,5.370411;Inherit;True;Property;_TextureLight;TextureLight;2;0;Create;True;0;0;False;0;None;1b8adcb49189eae4a827b62a21f52757;True;1;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  98. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;8;-232.8618,15.89621;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  99. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;11;11,1;Float;False;True;2;ASEMaterialInspector;0;1;Unlit/MrRoomnormal;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;0;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;True;False;True;0;False;-1;True;True;True;True;True;0;False;-1;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;RenderType=Opaque=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;0
  100. WireConnection;8;0;6;0
  101. WireConnection;8;1;7;0
  102. WireConnection;11;0;8;0
  103. ASEEND*/
  104. //CHKSM=26F3C3DFEED1A3DCD77D762A211DCCD06BCF7496