Hi there,
I have simple mesh with 2 parallel planes.
Also I have setup screen space ambient occlusion with com.unity.postprocessing package.
It works well with standard Default-Diffuse material:
Also I have shader which always returns white color.
The problem is when I assign custom material to the mesh, SSAO doesn’t get rendered:
How do I made ambient occlusion to appear within custom shader?
Shader code:
Shader "Origami/PaperShader"
{
SubShader
{
LOD 100
ZWrite Off
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Cull Off
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// vertex shader inputs
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
// vertex shader outputs ("vertex to fragment")
struct v2f
{
float2 uv : TEXCOORD0; // sheet coordinate
float4 vertex : SV_POSITION; // clip space position
};
// vertex shader
v2f vert (appdata v)
{
v2f o;
// transform position to clip space
o.vertex=UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
// pixel shader; returns low precision ("fixed4" type)
fixed4 frag(v2f i) : SV_Target
{
fixed4 col = fixed4(1.0,1.0,1.0,1.0);
return col;
}
ENDCG
}
}
}

