Hi, I'm following a tutorial and it calculates the depth of a fragment like this:
depth = -UnityObjectToViewPos(v.vertex).z * _ProjectionParams.w;
I don't understand what's the difference with the following:
depth = UnityObjectToClipPos(v.vertex).z;
Also why in the first case it's negative that value?
depth = -UnityObjectToViewPos(v.vertex).z * _ProjectionParams.w;
I don't understand what's the difference with the following:
depth = UnityObjectToClipPos(v.vertex).z;
Also why in the first case it's negative that value?