I have been using the Fur shader in the Wiki which works very nicely but in my latest effort I need to use the Depth of Field post effect and that conflicts with the Fur shader badly due to z not being written I guess for fur, does anyone know hwo to fix the shader or is there another shader free or paid for out there for doing fur for Unity. I saw a nice video on youtube of an XNA shader which even does moving fur, is there anything like that for Unity?
Chris
You can do a renderwith shader pass to get depth image
Shader "Hidden/Aubergine/Orthographic Depth" {
SubShader {
Pass {
Lighting Off Fog { Mode Off }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
struct v2f {
float4 pos : POSITION;
float3 Z : TEXCOORD0;
};
v2f vert (float4 vertex : POSITION) {
v2f o;
float4 oPos = mul(UNITY_MATRIX_MVP, vertex);
o.pos = oPos;
o.Z = oPos.zzz;
return o;
}
half4 frag( v2f i ) : COLOR {
return i.Z.xxxx;
}
ENDCG
}
}
}
Something like the above, that shader doesnt care for transparency, as its just a color shader.
And then use that image to do your own dof shader.