How do you setup the shader below then? I cannot get it to work. I've added
public Material GetMaterial()
{
return mMat;
}
to FOWImageEffect.cs and trying to get the textures like this
public FOWImageEffect _imageEffect;
public Material _fowMaterial;
IEnumerator Start ()
{
while (_imageEffect.GetMaterial() == null)
{
yield return new WaitForSeconds
(1f
); }
Material fowMat = _imageEffect.GetMaterial();
_fowMaterial.SetTexture("_FogTex0", fowMat.GetTexture("_FogTex0"));
_fowMaterial.SetTexture("_FogTex1", fowMat.GetTexture("_FogTex1"));
}
Not sure what the MainTex and Gradient parameters are and how to find them in the FOWImageEffect material. Notice: _fowMaterial refers to the material posted above. FogTex0 and FogTex1 are retrieved as expected, the texture shown by the RawImage component is white. Not sure where I would put "terrainOffset" and "terrainScale".