Three.js:Lambert 和 Phong 之间的确切区别是什么? [英] Three.js: What Is The Exact Difference Between Lambert and Phong?

查看:35
本文介绍了Three.js:Lambert 和 Phong 之间的确切区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解 Lambert 和 Phong 在一般计算机图形学中的区别.我也了解我们如何使用three.js 更改和创建我们自己的材料.但是我无法计算出 MeshLambertMaterial 和 MeshPhongMaterial 在默认状态下的区别.

I understand the difference between Lambert and Phong in general computer graphics. I also understand how we can change and create our own materials using three.js. But I cannot work out the difference between MeshLambertMaterial and MeshPhongMaterial in their default states.

我尝试在一个场景中使用一个定向光源和 125 个球体来切换它们,但我看不出任何区别.我的书的一章中使用了 Three.js,因此我需要确保所有信息准确无误.

I have tried switching them on a scene with one directional light source and 125 spheres, I cannot see any differences whatsoever. Three.js is being used in a chapter of my book and so I need to make sure all information is accurate and precise.

谢谢,谢恩

推荐答案

我假设你想要 MeshLambertMaterialMeshPhongMaterial 之间的确切区别,就像在three.js 中实现的那样.

I am assuming you want the exact difference between MeshLambertMaterial and MeshPhongMaterial as implemented in three.js.

您必须区分着色模型和照明模型.Three.js 没有实现纯"的 Phong 或 Lambert 模型.

You have to differentiate between the shading model and the illumination model. Three.js does not implement 'pure' Phong or Lambert models.

对于MeshLambertMaterial,在每个顶点执行照明计算,并且在多边形的面上对结果颜色进行插值.(Gouraud shading;(广义)Lambert 光照模型)

For MeshLambertMaterial, the illumination calculation is performed at each vertex, and the resulting color is interpolated across the face of the polygon. ( Gouraud shading; (generalized) Lambert illumination model )

对于MeshPhongMaterial,顶点法线在多边形的表面上进行插值,并在每个纹素处进行光照计算.( Phong shading; (广义) Phong 光照模型)

For MeshPhongMaterial, vertex normals are interpolated across the surface of the polygon, and the illumination calculation is performed at each texel. ( Phong shading; (generalized) Phong illumination model )

当您有一个靠近人脸的点光源时,您会看到明显的不同——尤其是当灯光的衰减距离小于到人脸顶点的距离时.

You will see a clear difference when you have a pointLight that is close to a face -- especially if the light's attenuation distance is less than the distance to the face's vertices.

对于这两种材质,在 FlatShading 的情况下,面法线替换了每个顶点法线.

For both materials, in the case of FlatShading, the face normal replaces each vertex normal.

three.js.r.66

three.js.r.66

这篇关于Three.js:Lambert 和 Phong 之间的确切区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆