Preview_ShadeVertexLights.shader 717 B

1234567891011121314151617181920212223242526272829303132333435
  1. Shader "Hidden/ShadeVertexLights"
  2. {
  3. Properties
  4. {
  5. _A ("_A", 2D) = "white" {}
  6. _B ("_B", 2D) = "white" {}
  7. _LightCount( "_LightCount", Int ) = 4
  8. _IsSpotlight ("_IsSpotlight", Int) = 0
  9. }
  10. SubShader
  11. {
  12. Pass
  13. {
  14. CGPROGRAM
  15. #include "UnityCG.cginc"
  16. #include "Preview.cginc"
  17. #pragma vertex vert_img
  18. #pragma fragment frag
  19. sampler2D _A;
  20. sampler2D _B;
  21. int _LightCount;
  22. int _IsSpotlight;
  23. float4 frag( v2f_img i ) : SV_Target
  24. {
  25. float4 vertexPosition = tex2D( _A, i.uv );
  26. float3 vertexNormal = tex2D( _B, i.uv ).xyz;
  27. float3 result = ShadeVertexLightsFull (vertexPosition, vertexNormal, _LightCount, (_IsSpotlight > 0));
  28. return float4(result, 1);
  29. }
  30. ENDCG
  31. }
  32. }
  33. }