-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2323 from capdevon/capdevon-TerrainMatDef
Fix for issue #2300: Removed incorrect 'Technique' block in terrain j3md files.
- Loading branch information
Showing
2 changed files
with
54 additions
and
57 deletions.
There are no files selected for viewing
73 changes: 36 additions & 37 deletions
73
jme3-terrain/src/main/resources/Common/MatDefs/Terrain/HeightBasedTerrain.j3md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,44 @@ | ||
MaterialDef Terrain { | ||
|
||
// Parameters to material: | ||
// regionXColorMap: X = 1..4 the texture that should be applied 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 { | ||
Int BoundDrawBuffer | ||
Texture2D region1ColorMap | ||
Texture2D region2ColorMap | ||
Texture2D region3ColorMap | ||
Texture2D region4ColorMap | ||
Texture2D slopeColorMap | ||
Float slopeTileFactor | ||
Float terrainSize | ||
Vector3 region1 | ||
Vector3 region2 | ||
Vector3 region3 | ||
Vector3 region4 | ||
} | ||
// Parameters to material: | ||
// regionXColorMap: X = 1..4 the texture that should be applied 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) | ||
|
||
Technique { | ||
VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/HeightBasedTerrain.vert | ||
FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/HeightBasedTerrain.frag | ||
MaterialParameters { | ||
Int BoundDrawBuffer | ||
Texture2D region1ColorMap | ||
Texture2D region2ColorMap | ||
Texture2D region3ColorMap | ||
Texture2D region4ColorMap | ||
Texture2D slopeColorMap | ||
Float slopeTileFactor | ||
Float terrainSize | ||
Vector3 region1 | ||
Vector3 region2 | ||
Vector3 region3 | ||
Vector3 region4 | ||
} | ||
|
||
WorldParameters { | ||
WorldViewProjectionMatrix | ||
WorldMatrix | ||
NormalMatrix | ||
} | ||
Defines { | ||
BOUND_DRAW_BUFFER: BoundDrawBuffer | ||
Technique { | ||
VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/HeightBasedTerrain.vert | ||
FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/HeightBasedTerrain.frag | ||
|
||
WorldParameters { | ||
WorldViewProjectionMatrix | ||
WorldMatrix | ||
NormalMatrix | ||
} | ||
} | ||
|
||
Technique { | ||
Defines { | ||
BOUND_DRAW_BUFFER: BoundDrawBuffer | ||
} | ||
} | ||
|
||
} |
38 changes: 18 additions & 20 deletions
38
jme3-terrain/src/main/resources/Common/MatDefs/Terrain/Terrain.j3md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
MaterialDef Terrain { | ||
|
||
MaterialParameters { | ||
Int BoundDrawBuffer | ||
MaterialParameters { | ||
Int BoundDrawBuffer | ||
|
||
// use tri-planar mapping | ||
Boolean useTriPlanarMapping | ||
|
||
Texture2D Alpha -LINEAR | ||
Texture2D Tex1 | ||
Texture2D Tex2 | ||
Texture2D Tex3 | ||
Float Tex1Scale | ||
Float Tex2Scale | ||
Float Tex3Scale | ||
} | ||
Texture2D Alpha -LINEAR | ||
Texture2D Tex1 | ||
Texture2D Tex2 | ||
Texture2D Tex3 | ||
Float Tex1Scale | ||
Float Tex2Scale | ||
Float Tex3Scale | ||
} | ||
|
||
Technique { | ||
VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/Terrain.vert | ||
FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/Terrain.frag | ||
|
||
Technique { | ||
VertexShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/Terrain.vert | ||
FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Terrain/Terrain.frag | ||
|
||
WorldParameters { | ||
WorldViewProjectionMatrix | ||
} | ||
WorldParameters { | ||
WorldViewProjectionMatrix | ||
} | ||
|
||
Defines { | ||
BOUND_DRAW_BUFFER: BoundDrawBuffer | ||
TRI_PLANAR_MAPPING : useTriPlanarMapping | ||
} | ||
} | ||
|
||
Technique { | ||
} | ||
|
||
} |