Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

UnityObjectToViewPos * ProjectionParams.w vs UnityObjectToClipPos

$
0
0
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?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>