前言 在上一篇文章中,我们实现了URP下深度图的使用。 Unity中URP下开启和使用深度图 但是,因为是使用模型UV采样的原因。所以,深度图效果不对 所以,在这一篇文章中,我们使用屏幕坐标来采样深度图。 一、Unity使用了ComputeScreenPos函数得到屏幕坐标 齐次裁剪空间进行透视除法 x n d c = x w x_{ndc} = \frac{x}{w} xndc=wx 然后进行如下步骤,化简得到该函数结果 x s c r e e n = ( x n d c ∗ 0.5 + 0.5 ) ∗ w i d t h x_{screen} = (x_{ndc}*0.5+0.5)*width xscreen=(xndc∗0.5+0.5)∗width x s c r e e n = ( x w ∗ 0.5 + 0.5 ) ∗ w i d t h x_{screen} = (\frac{x}{w}*0.5+0.5)*width xscreen=(wx∗0.5+0.5)∗width x s c r e e n w i d t h = ( x w ∗ 0.5 + 0.5...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with return
Contact return, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack