In preparation for switching the Ca3D-Engine core to use the new MatSys for all rendering, I converted this week the old TerrainViewer to use the MatSys. In parallel, I added features to the MatSys that were still missing but required for the rendering of huge terrains. This has partially been very difficult due to the special nature of terrains: Their need for automatically generated texture coordinates, specific texture wrap modes and the combination of terrain and detail textures all have to be mastered by the MatSys.
Therefore, I took the large-scale approach for a solution:
- Added arbitrary wrap mode support to the "map compositions" that can be specified in the cmap material scripts.
- Added general-purpose rendering parameters that can be set in CaWE, by (future) entity scripts, and by engine and MOD code. These parameters are accessible in the cmap files.
- Added general-purpose shader parameters that the cmap scripts can set in order to control the shaders.
Details will be presented in the documentation that comes with the next New Materials Development Kit.
Oh, and the terrain rendering works now, too: