Fantasy Adventure Environment Documentation

Fantasy Adventure Environment
Author: jonathan
Version: 1.5.1
Dated: 30 May 2017

Pigment map #

This feature is only available for the built-in render pipeline. The Stylized Grass Shader offers a grass solution for the URP and includes this feature

This script must be added to your terrain object. It generates a color map texture (pigment map) and heightmap (stored in the alpha channel) for the FAE/Grass shader (see shaders section). Which can be utilized in the material to tint the grass by the terrain’s color and have the height taper off where there is no grass texture painted.

Only one texture is supported as a height source. So if you have multiple textures on your terrain that represent grass, it’s best to set the dropdown to “None” and not use the height feature altogether.

This script is compatible with any third-party terrain shader, and will not impair their functionality.

This feature cannot be used when the terrain is using baked lightmaps or realtime GI since this will affect the render

Attaching this script to your terrain will load its pigment map on startup. So it’s possible to be used in multiple scenes. Do note that only one pigment map can be assigned to the grass shader at a time.

Once this map is generated, you can adjust pigment map’s influence on the material (if this is set to 1, without a pigment map present, the grass will appear gray).

If you have selected a terrain material in the “Grass texture dropdown”, the minimum and maximum grass height in any material using the FAE/Grass shader can be adjusted. This is according to how strongly the terrain texture is painted on the terrain.


Multi-terrain setups
To render a pigment map from multiple terrain tiles, add the script to an empty GameObject (preferably the parent object of your terrain tiles). Please note this object must be active in a build, in order to load and assign the pigment map to the grass shader.

Once you’ve done this, a list will appear in the inspector, allowing you to add the terrain objects.

Mesh terrains
The script also works with mesh terrains. However, like Unity terrain’s, the size must be uniform, and the pivot point must be in the corner. If a mesh terrain fails to meet these requirements the pigment map will not line up accordingly.

When using a mesh terrain, option to flip or rotate the pigment map will be available, in case your mesh’s UV’s are set up differently.

Suggest edit
Last updated on June 25, 2020
0 of 0 users found this section helpful
Suggest Edit