Hi,
I have recently come upon a severe issue with the standard “Nature-Tree Creator Bark” shader and Projector shaders. The projector one below is rather simple and i use it to project shadows from my Sky Master clouds. The problem is that it does not get the mesh of the tree barks properly when using the “Nature-Tree Creator Bark” shader. If i use diffuse shader works fine.
Is there a solution to the problem ? I can ignore layers in custom trees, but cannot do the same for terrain ones. Can i override the Unitys bark shader somehow, maybe to ignore projection ? Or solve it any other way ?
Thanks
Shader "Projector/SimpleProjectorShader_SkyMaster" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Projected Image", 2D) = "white" {}
}
SubShader {
Pass {
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color;
uniform sampler2D _ShadowTex;
uniform float4x4 _Projector;
struct vertexOutput {
float4 pos : POSITION;
float4 posProj : TEXCOORD0;
};
vertexOutput vert(appdata_base v) {
vertexOutput output;
output.posProj = mul(_Projector, v.vertex);
output.pos = mul(UNITY_MATRIX_MVP, v.vertex);
return output;
}
float4 frag(vertexOutput input) : COLOR{
return fixed4(0.0,0.0,0.0,0.8);
}
ENDCG
}
}
// Fallback "Projector/Light"
}
Pics from a terrain and a custom (not on terrain) tree, using the same Bark shader