Home | History | Annotate | Download | only in Terrain
      1 MaterialDef Terrain {
      2 
      3         // Parameters to material:
      4         // regionXColorMap: X = 1..4 the texture that should be appliad to state X
      5         // regionX: a Vector3f containing the following information:
      6         //      regionX.x: the start height of the region
      7         //      regionX.y: the end height of the region
      8         //      regionX.z: the texture scale for the region
      9         //  it might not be the most elegant way for storing these 3 values, but it packs the data nicely :)
     10         // slopeColorMap: the texture to be used for cliffs, and steep mountain sites
     11         // slopeTileFactor: the texture scale for slopes
     12         // terrainSize: the total size of the terrain (used for scaling the texture)
     13 	MaterialParameters {
     14 		Texture2D region1ColorMap
     15 		Texture2D region2ColorMap
     16 		Texture2D region3ColorMap
     17 		Texture2D region4ColorMap
     18 		Texture2D slopeColorMap
     19 		Float slopeTileFactor
     20 		Float terrainSize
     21 		Vector3 region1
     22 		Vector3 region2
     23 		Vector3 region3
     24 		Vector3 region4
     25 	}
     26 
     27 	Technique {
     28 		VertexShader GLSL100:   Common/MatDefs/Terrain/HeightBasedTerrain.vert
     29 		FragmentShader GLSL100: Common/MatDefs/Terrain/HeightBasedTerrain.frag
     30 
     31 		WorldParameters {
     32 			WorldViewProjectionMatrix
     33 			WorldMatrix
     34 			NormalMatrix
     35 		}
     36 	}
     37 
     38 	Technique FixedFunc {
     39     }
     40 
     41 }