Babylon.js 去除球体的光反射

Ves*_*smy 3 javascript light babylonjs

如何在 Babylon.js 中消除球体的(点)光反射?

// Point light.
const light = new BABYLON.PointLight('myLight', new BABYLON.Vector3(0, 1, 0), scene)

// Sphere with size 100.
const newBox = BABYLON.Mesh.CreateSphere('mySphere', 64, 100, scene)
Run Code Online (Sandbox Code Playgroud)

我想照亮一半球体,但不要在红色圆圈中反射:

在此输入图像描述

Ves*_*smy 7

我找到了解决方案:

newBox.material = someMaterial
newBox.material.specularColor = new BABYLON.Color3(0, 0, 0);
Run Code Online (Sandbox Code Playgroud)

  • 您实际上所做的是将 [Phong 反射模型](https://en.wikipedia.org/wiki/Phong_reflection_model) 简化为 [朗伯漫反射模型](https://en.wikipedia.org/wiki/ Lambertian_reflectance),通过消除 phong 模型的镜面高光。 (2认同)