Three.js:什么是之间Lambert和海防准确的区别?海防、区别、准确、Three

2023-09-07 17:24:13 作者:冰是睡着の水

我明白在一般的计算机图形Lambert和蓬之间的差异。我也明白,我们如何改变和使用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被用来在我的书的一章,所以我需要确保所有信息的准确性和precise。

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.

谢谢, 巴蒂尔

推荐答案

我假设你想要的 MeshLambertMaterial 的具体差异, MeshPhongMaterial 在three.js实现的。

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

您有遮光模型和光照模型之间进行区分。 Three.js没有实现纯海防和兰伯特模型。

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

有关 MeshLambertMaterial 中,照明计算在每个顶点执行,并且在整个多边形的表面产生的颜色进行内插。 (洛德着色;(广义)兰伯特光照模型)

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浓淡;(广义)的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

 
精彩推荐
图片推荐