terrain.material 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // Default Terrain material file.
  3. //
  4. // In addition to the built-in Node material auto-bindings, the following terrain-specific
  5. // auto-bindings are also supported:
  6. //
  7. // TERRAIN_NORMAL_MAP : normal map sampler (if using a normal map)
  8. // TERRAIN_LAYER_MAPS : array of texture samplers for each terrain layer
  9. // TERRAIN_ROW : row index of the current terrain patch
  10. // TERRAIN_COLUMN : column index of the current terrain patch
  11. //
  12. // To add lighting (other than ambient) to a terrain, you can add additional pass defines and
  13. // uniform bindings and handle them in your specific game or renderer. See the gameplay
  14. // terrain sample for an example.
  15. //
  16. material terrain
  17. {
  18. u_worldViewProjectionMatrix = WORLD_VIEW_PROJECTION_MATRIX
  19. u_normalMatrix = INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX
  20. //u_normalMap = TERRAIN_NORMAL_MAP
  21. u_surfaceLayerMaps = TERRAIN_LAYER_MAPS
  22. u_ambientColor = SCENE_AMBIENT_COLOR
  23. renderState
  24. {
  25. cullFace = true
  26. depthTest = true
  27. }
  28. technique
  29. {
  30. pass
  31. {
  32. vertexShader = res/shaders/terrain.vert
  33. fragmentShader = res/shaders/terrain.frag
  34. }
  35. }
  36. }