1// NOTE: Doesn't support OpenGL1
2MaterialDef Terrain Lighting {
3
4    MaterialParameters {
5
6        // use tri-planar mapping
7        Boolean useTriPlanarMapping
8
9        // Use ward specular instead of phong
10        Boolean WardIso
11
12        // Are we rendering TerrainGrid
13        Boolean isTerrainGrid
14
15        // Ambient color
16        Color Ambient
17
18        // Diffuse color
19        Color Diffuse
20
21        // Specular color
22        Color Specular
23
24        // Specular power/shininess
25        Float Shininess : 1
26
27        // Texture map #0
28        Texture2D DiffuseMap
29        Float DiffuseMap_0_scale
30        Texture2D NormalMap
31
32        // Texture map #1
33        Texture2D DiffuseMap_1
34        Float DiffuseMap_1_scale
35        Texture2D NormalMap_1
36
37        // Texture map #2
38        Texture2D DiffuseMap_2
39        Float DiffuseMap_2_scale
40        Texture2D NormalMap_2
41
42        // Texture map #3
43        Texture2D DiffuseMap_3
44        Float DiffuseMap_3_scale
45        Texture2D NormalMap_3
46
47        // Texture map #4
48        Texture2D DiffuseMap_4
49        Float DiffuseMap_4_scale
50        Texture2D NormalMap_4
51
52        // Texture map #5
53        Texture2D DiffuseMap_5
54        Float DiffuseMap_5_scale
55        Texture2D NormalMap_5
56
57        // Texture map #6
58        Texture2D DiffuseMap_6
59        Float DiffuseMap_6_scale
60        Texture2D NormalMap_6
61
62        // Texture map #7
63        Texture2D DiffuseMap_7
64        Float DiffuseMap_7_scale
65        Texture2D NormalMap_7
66
67        // Texture map #8
68        Texture2D DiffuseMap_8
69        Float DiffuseMap_8_scale
70        Texture2D NormalMap_8
71
72        // Texture map #9
73        Texture2D DiffuseMap_9
74        Float DiffuseMap_9_scale
75        Texture2D NormalMap_9
76
77        // Texture map #10
78        Texture2D DiffuseMap_10
79        Float DiffuseMap_10_scale
80        Texture2D NormalMap_10
81
82        // Texture map #11
83        Texture2D DiffuseMap_11
84        Float DiffuseMap_11_scale
85        Texture2D NormalMap_11
86
87
88        // Specular/gloss map
89        Texture2D SpecularMap
90
91
92        // Texture that specifies alpha values
93        Texture2D AlphaMap
94        Texture2D AlphaMap_1
95        Texture2D AlphaMap_2
96
97        // Texture of the glowing parts of the material
98        Texture2D GlowMap
99
100        // The glow color of the object
101        Color GlowColor
102    }
103
104    Technique {
105
106        LightMode MultiPass
107
108        VertexShader GLSL100:   Common/MatDefs/Terrain/TerrainLighting.vert
109        FragmentShader GLSL100: Common/MatDefs/Terrain/TerrainLighting.frag
110
111        WorldParameters {
112            WorldViewProjectionMatrix
113            NormalMatrix
114            WorldViewMatrix
115            ViewMatrix
116        }
117
118        Defines {
119            TRI_PLANAR_MAPPING : useTriPlanarMapping
120            TERRAIN_GRID : isTerrainGrid
121            WARDISO   : WardIso
122
123            DIFFUSEMAP : DiffuseMap
124            DIFFUSEMAP_1 : DiffuseMap_1
125            DIFFUSEMAP_2 : DiffuseMap_2
126            DIFFUSEMAP_3 : DiffuseMap_3
127            DIFFUSEMAP_4 : DiffuseMap_4
128            DIFFUSEMAP_5 : DiffuseMap_5
129            DIFFUSEMAP_6 : DiffuseMap_6
130            DIFFUSEMAP_7 : DiffuseMap_7
131            DIFFUSEMAP_8 : DiffuseMap_8
132            DIFFUSEMAP_9 : DiffuseMap_9
133            DIFFUSEMAP_10 : DiffuseMap_10
134            DIFFUSEMAP_11 : DiffuseMap_11
135            NORMALMAP : NormalMap
136            NORMALMAP_1 : NormalMap_1
137            NORMALMAP_2 : NormalMap_2
138            NORMALMAP_3 : NormalMap_3
139            NORMALMAP_4 : NormalMap_4
140            NORMALMAP_5 : NormalMap_5
141            NORMALMAP_6 : NormalMap_6
142            NORMALMAP_7 : NormalMap_7
143            NORMALMAP_8 : NormalMap_8
144            NORMALMAP_9 : NormalMap_9
145            NORMALMAP_10 : NormalMap_10
146            NORMALMAP_11 : NormalMap_11
147            SPECULARMAP : SpecularMap
148            ALPHAMAP : AlphaMap
149            ALPHAMAP_1 : AlphaMap_1
150            ALPHAMAP_2 : AlphaMap_2
151            DIFFUSEMAP_0_SCALE : DiffuseMap_0_scale
152            DIFFUSEMAP_1_SCALE : DiffuseMap_1_scale
153            DIFFUSEMAP_2_SCALE : DiffuseMap_2_scale
154            DIFFUSEMAP_3_SCALE : DiffuseMap_3_scale
155            DIFFUSEMAP_4_SCALE : DiffuseMap_4_scale
156            DIFFUSEMAP_5_SCALE : DiffuseMap_5_scale
157            DIFFUSEMAP_6_SCALE : DiffuseMap_6_scale
158            DIFFUSEMAP_7_SCALE : DiffuseMap_7_scale
159            DIFFUSEMAP_8_SCALE : DiffuseMap_8_scale
160            DIFFUSEMAP_9_SCALE : DiffuseMap_9_scale
161            DIFFUSEMAP_10_SCALE : DiffuseMap_10_scale
162            DIFFUSEMAP_11_SCALE : DiffuseMap_11_scale
163        }
164    }
165
166    Technique PreShadow {
167
168        VertexShader GLSL100 :   Common/MatDefs/Shadow/PreShadow.vert
169        FragmentShader GLSL100 : Common/MatDefs/Shadow/PreShadow.frag
170
171        WorldParameters {
172            WorldViewProjectionMatrix
173            WorldViewMatrix
174        }
175
176        Defines {
177            DIFFUSEMAP_ALPHA : DiffuseMap
178        }
179
180        RenderState {
181            FaceCull Off
182            DepthTest On
183            DepthWrite On
184            PolyOffset 5 0
185            ColorWrite Off
186        }
187
188    }
189
190  Technique PreNormalPass {
191
192        VertexShader GLSL100 :   Common/MatDefs/SSAO/normal.vert
193        FragmentShader GLSL100 : Common/MatDefs/SSAO/normal.frag
194
195        WorldParameters {
196            WorldViewProjectionMatrix
197            WorldViewMatrix
198            NormalMatrix
199        }
200
201        Defines {
202            DIFFUSEMAP_ALPHA : DiffuseMap
203        }
204
205        RenderState {
206
207        }
208
209    }
210
211    Technique GBuf {
212
213        VertexShader GLSL100:   Common/MatDefs/Light/GBuf.vert
214        FragmentShader GLSL100: Common/MatDefs/Light/GBuf.frag
215
216        WorldParameters {
217            WorldViewProjectionMatrix
218            WorldMatrix
219        }
220
221        Defines {
222            VERTEX_COLOR : UseVertexColor
223            MATERIAL_COLORS : UseMaterialColors
224            V_TANGENT : VTangent
225            MINNAERT  : Minnaert
226            WARDISO   : WardIso
227
228            DIFFUSEMAP : DiffuseMap
229            NORMALMAP : NormalMap
230            SPECULARMAP : SpecularMap
231            PARALLAXMAP : ParallaxMap
232        }
233    }
234
235    Technique FixedFunc {
236        LightMode FixedPipeline
237    }
238
239    Technique Glow {
240
241        VertexShader GLSL100:   Common/MatDefs/Misc/SimpleTextured.vert
242        FragmentShader GLSL100: Common/MatDefs/Light/Glow.frag
243
244        WorldParameters {
245            WorldViewProjectionMatrix
246        }
247
248        Defines {
249            HAS_GLOWMAP : GlowMap
250            HAS_GLOWCOLOR : GlowColor
251        }
252    }
253
254}