aboutsummaryrefslogtreecommitdiff
path: root/engine/src/terrain/Common/MatDefs/Terrain/HeightBasedTerrain.j3md
blob: 4b836f0872f1e602e51b643f7b7ae859845c221a (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
MaterialDef Terrain {

        // Parameters to material:
        // regionXColorMap: X = 1..4 the texture that should be appliad to state X
        // regionX: a Vector3f containing the following information:
        //      regionX.x: the start height of the region
        //      regionX.y: the end height of the region
        //      regionX.z: the texture scale for the region
        //  it might not be the most elegant way for storing these 3 values, but it packs the data nicely :)
        // slopeColorMap: the texture to be used for cliffs, and steep mountain sites
        // slopeTileFactor: the texture scale for slopes
        // terrainSize: the total size of the terrain (used for scaling the texture)
	MaterialParameters {
		Texture2D region1ColorMap
		Texture2D region2ColorMap
		Texture2D region3ColorMap
		Texture2D region4ColorMap
		Texture2D slopeColorMap
		Float slopeTileFactor
		Float terrainSize
		Vector3 region1
		Vector3 region2
		Vector3 region3
		Vector3 region4
	}

	Technique {
		VertexShader GLSL100:   Common/MatDefs/Terrain/HeightBasedTerrain.vert
		FragmentShader GLSL100: Common/MatDefs/Terrain/HeightBasedTerrain.frag

		WorldParameters {
			WorldViewProjectionMatrix
			WorldMatrix
			NormalMatrix
		}
	}

	Technique FixedFunc {
    }

}