- Home /
How to Expose a Terrain's Grass Shader Properties?
I'm working on a grass shader for the LWRP, but am having trouble setting a shader property. As grass shaders do not seem to have an exposed material to work with, is there an entrypoint for supplying a non-global texture / property?
The default LWRP grass shader clearly defines properties that are used by the terrain engine (and these are set by TerrainData properties), so I assume Unity does have a way of accessing them. In my case, I've added an extra Texture for grass volume / depression:
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Hidden/TerrainEngine/Details/LightweightPipeline/Override/WavingDoublePass"
{
Properties
{
_WavingTint ("Fade Color", Color) = (.7,.6,.5, 0)
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
_WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1)
_Cutoff ("Cutoff", float) = 0.5
_VolumeData ("Grass Depression", 2D) = "black" {}
}
//...
}
There's going to be a trivial solution here, but it's not coming to me. A post from 2015 had a similar problem, but I didn't have luck with setting the texture globally either. Thanks.
Your answer
Follow this Question
Related Questions
Hide Grass and Trees applied to terrain? 2 Answers
Swapping terrain lightmaps does not affect grass? 1 Answer
Grass + lighting? 0 Answers
Gras Dissapears in build 1 Answer
GPU Grass on a Mesh 0 Answers