This shader will accept a link to any Terrain Operator, and render either the height map or the height map's 1st derivative (the slope map) from it. This works ‘live’, without requiring you to fumble around with textures.
The shader can be used as an alternative to Cinema 4D's own Terrain Mask Shader. While the Terrain Mask will always evaluate the actual geometry it's being rendered on, the TF4D Operator Shader enables you to choose which operator to get the data from. That makes it a lot easier to e.g. distribute grass on plains, even if they are in fact very bumpy (as long as the bumps are created in another operator). You can simply choose not to render the bumpy operator.
Note: The shader will only render a default gradient in the material and shader previews.
The Operator Shader offers the following attributes.
Link the operator that you want to render here.
Set the source data here. Available are:
Renders the operator's height field. The lowest parts will render black, brightness will increase with increasing altitude.
Renders the operators's slope map (1st derivative of the height map). Flat plains will render black, slopes will render brighter with increasing steepness.
- Fields Mask
Renders the mask that is created by the operator's Field list. If you have constrained operators locally using Fields, you can now do the same with the shader.
Include Fields Mask
Enable this option to render Altitude and Slope including the Fields mask's effect.
Obviously, this option is not available for the Source ‘Fields Mask’.
Slope, by default, is the difference between the normal of a terrain point and the +Y direction. Optionally, you can change the comparison direction to a custom normal vector, enabling you to e.g. distribute more grass on the sunny side of a hill.
This parameter is only available if ‘Source’ is set to ‘Slope’!
There are different interpolation modes available:
This mode does not interpolate at all, the result looks pixellated. But it sure it fast.
Uses a simple bilinear interpolation. It's smooth, with medium quality, and calculates quite fast.
Uses a bicubic hermite interpolation. It's very smooth, detailed, and high quality. Rendering is slightly slower than the other modes.
Use this gradient to colorize the shader's output.