VD-SelfIllum-Diffuse.shader 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Shader "VD Vertex Color/Self-Illumin Diffuse" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB)", 2D) = "white" {}
  5. _Illum ("Illumin (A)", 2D) = "white" {}
  6. _EmissionLM ("Emission (Lightmapper)", Float) = 0
  7. }
  8. SubShader {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 200
  11. CGPROGRAM
  12. #pragma surface surf Lambert vertex:vert
  13. sampler2D _MainTex;
  14. sampler2D _Illum;
  15. half4 _Color;
  16. struct Input {
  17. half2 uv_MainTex;
  18. half2 uv_Illum;
  19. half4 color;
  20. };
  21. void vert (inout appdata_full v, out Input o) {
  22. UNITY_INITIALIZE_OUTPUT(Input,o);
  23. o.color = v.color;
  24. }
  25. void surf (Input IN, inout SurfaceOutput o) {
  26. half4 t = tex2D(_MainTex, IN.uv_MainTex);
  27. half4 c = t * _Color;
  28. o.Albedo = c.rgb * IN.color;
  29. o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a;
  30. o.Alpha = c.a;
  31. }
  32. ENDCG
  33. }
  34. Fallback "Self-Illumin/VertexLit"
  35. }