summaryrefslogtreecommitdiffstats
path: root/Shaders/PBS.shader
blob: e0b39da3171fec1116c674482a1802fd192879ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Shader "TaSTT/Simple_PBS"
{
  Properties
  {
    [MaterialToggle] BG_Enable("Enable custom background", float) = 0
    BG_BaseColor("Background base color", 2D) = "black" {}
    [NoScaleOffset] BG_NormalMap ("Background normal map", 2D) = "bump" {}
    BG_NormalStrength ("Background normal strength", Float) = 1
    BG_Smoothness("Background smoothness", 2D) = "black" {}
    [MaterialToggle]BG_Smoothness_Invert("Invert background smoothness", float) = 1
    BG_Metallic("Background metallic", 2D) = "black" {}
    BG_Emission_Mask("Background emission mask", 2D) = "black" {}
    BG_Emission_Color("Background emission color", Color) = (0, 0, 0)

    [MaterialToggle] Enable_Custom_Cubemap("Enable custom cubemap", float) = 0
		Custom_Cubemap("Custom cubemap", Cube) = "" {}

    // %TEMPLATE__UNITY_ROW_COL_PARAMS%
  }
  SubShader
  {
    Pass {
      Tags {
        "RenderType"="Opaque"
        "Queue"="AlphaTest+499"
        "LightMode" = "ForwardBase"
      }
      Blend SrcAlpha OneMinusSrcAlpha

      CGPROGRAM
      #pragma target 3.0

      #pragma multi_compile _ VERTEXLIGHT_ON

      #pragma vertex vert
      #pragma fragment frag

      #define FORWARD_BASE_PASS

      #include "PBS_lighting.cginc"
      ENDCG
    }
    Pass {
      Tags {
        "RenderType" = "Opaque"
        "LightMode" = "ForwardAdd"
        "Queue"="AlphaTest+499"
      }
      Blend One One
      ZWrite Off

      CGPROGRAM
      #pragma target 3.0

      #pragma multi_compile_fwdadd

      #pragma vertex vert
      #pragma fragment frag

      #include "PBS_lighting.cginc"
      ENDCG
    }
  }
}