three.jsrenderingambient

three.js R71 - ambient removed, how configure to get same rendering results?


In three.js r71 the ambient property has been removed from THREE.Material.

Previously I used ambient to set correct rendering (lighting) effect of the materials that I used on my meshes. Now the appearance of all my meshes changed dramatically.

How can I get my materials rendered exactly as before r71?


Solution

  • Here comes the why...

    According to @WestLangley; I quote from his post in the discussion (link from @pprchsvr):

    material.ambient was the ambient reflectance of the material. For real-world objects, it should normally match material.color, the diffuse reflectance of the material. (Objects, after all, do not know where the photons came from.)

    We chose to simplify the API, and hardwire material.ambient to match material.color. Consequently, material.ambient has been removed.

    This means you will no longer be able to set an ambient color that differs from the material color and there is as far as I know no "quick fix" to get the same rendering results for those materials as before.