Hello
I am making a shader that uses modified z-buffer. I have modified a vertex shader to:
v2f vert (appdata v) {
v2f o;
const float C = 0.1;
const float far = 1.0e10;
const float offset = 1.0;
o.pos = mul( UNITY_MATRIX_MVP, v.vertex );
o.pos.z = ( 2 * log(C*v.vertex.z+offset) / log(C*far+offset) - 0 ) * v.vertex.w;
o.uv = float4( v.texcoord.xy, 0, 0 );
return o;
}
Take a look at the result screenshot showing the scene in unity, running under windows and mac.
The problem is that it looks as it should on Mac, and it looks weird on Windows. The code seems to be ok, so what could be the problem then?
Buld&Run shows the exact same results.
