Transparent.shader 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Shader "Emulated Mipmap/Standard Transparent" {
  2. Properties {
  3. _Color("Color", Color) = (1, 1, 1, 1)
  4. _MainTex("Albedo (RGB)", 2D) = "white" {}
  5. _Glossiness("Smoothness", Range(0, 1)) = 0.5
  6. _Metallic("Metallic", Range(0, 1)) = 0.0
  7. _SampleMultiplier("Sample Multiplier", Range(0, 8)) = 1.0
  8. _MaxSamplesPerLine("Line Sample Limit", Range(1, 50)) = 10
  9. }
  10. SubShader {
  11. Tags {
  12. "RenderType" = "Transparent"
  13. }
  14. LOD 200
  15. CGPROGRAM
  16. #pragma surface surf Standard fullforwardshadows alpha
  17. #pragma target 3.0
  18. sampler2D _MainTex;
  19. float4 _MainTex_TexelSize;
  20. struct Input {
  21. float2 uv_MainTex;
  22. };
  23. half _Glossiness;
  24. half _Metallic;
  25. float _SampleMultiplier;
  26. int _MaxSamplesPerLine;
  27. fixed4 _Color;
  28. #include "./MipSample.cginc"
  29. void surf(Input IN, inout SurfaceOutputStandard o) {
  30. fixed4 c = mipSample(
  31. _MainTex, IN.uv_MainTex,
  32. _MainTex_TexelSize.zw,
  33. _MaxSamplesPerLine, _SampleMultiplier
  34. );
  35. o.Albedo = _Color * c;
  36. o.Metallic = _Metallic;
  37. o.Smoothness = _Glossiness;
  38. o.Alpha = c.a;
  39. }
  40. ENDCG
  41. }
  42. FallBack "Standard"
  43. }