Test.shader 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Shader "Custom/Test"
  2. {
  3. Properties {
  4. _Color ("Color", Color) = (1,1,1,1)
  5. _MainTex ("Albedo (RGB)", 2D) = "white" {}
  6. _Glossiness ("Smoothness", Range(0,1)) = 0.5
  7. _Metallic ("Metallic", Range(0,1)) = 0.0
  8. _OcclusionColor("OcclusionColor",COLOR)=(0.5,1,0.5,1)
  9. }
  10. SubShader
  11. {
  12. Tags{"RenderType"="Opaque" "Queue"="Transparent"}
  13. LOD 500
  14. pass
  15. {
  16. ZTest Greater
  17. ZWrite off
  18. CGPROGRAM
  19. #pragma vertex vert
  20. #pragma fragment frag
  21. fixed4 _OcclusionColor;
  22. float4 vert(float4 v:POSITION):SV_POSITION
  23. {
  24. return UnityObjectToClipPos(v);
  25. }
  26. fixed4 frag():SV_Target
  27. {
  28. return _OcclusionColor;
  29. }
  30. ENDCG
  31. }
  32. ZTest LEqual
  33. CGPROGRAM
  34. #pragma surface surf Standard fullforwardshadows
  35. #pragma target 3.0
  36. sampler2D _MainTex;
  37. struct Input {
  38. float2 uv_MainTex;
  39. };
  40. half _Glossiness;
  41. half _Metallic;
  42. fixed4 _Color;
  43. void surf (Input IN, inout SurfaceOutputStandard o) {
  44. fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
  45. o.Albedo = c.rgb;
  46. o.Metallic = _Metallic;
  47. o.Smoothness = _Glossiness;
  48. o.Alpha = c.a;
  49. }
  50. ENDCG
  51. }
  52. FallBack "Diffuse"
  53. }