注释中给的差值后的深度代码为:
float Z = 1.0 / (alpha / v[0].w() + beta / v[1].w() + gamma / v[2].w());
float zp = alpha * v[0].z() / v[0].w() + beta * v[1].z() / v[1].w() + gamma * v[2].z() / v[2].w();
zp *= Z;
这个我不太理解。按照老师上课上课的讲解(见附图),我觉得深度应该是
alpha * v[0].w() + beta * v[1].w() + gamma * v[2].w()
我觉得应该是下面两行注释没看懂,请问是否能做更详细的解释?非常感谢!
// * Z is interpolated view space depth for the current pixel
// * zp is depth between zNear and zFar, used for z-buffer
-
This topic was modified 4 years, 9 months ago by Vinal.
Attachments:
You must be
logged in to view attached files.