Guest User

Height based custom material - material definition file

a guest
May 19th, 2013
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.36 KB | None | 0 0
  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.                 Float maxSlopeAngle
  26.                 Float minSlopeAngle
  27.     }
  28.  
  29.     Technique {
  30.  
  31.                 LightMode MultiPass
  32.  
  33.         VertexShader GLSL100:  Shaders/HeightBasedCustom.vert
  34.         FragmentShader GLSL100: Shaders/HeightBasedCustom.frag
  35.  
  36.         WorldParameters {
  37.             WorldViewProjectionMatrix
  38.             WorldMatrix
  39.             NormalMatrix
  40.         }
  41.     }
  42.  
  43.     Technique {
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment