Three.js: MeshLambertMaterial makes no distinction on source of shadow.

Created on 25 Nov 2017  路  6Comments  路  Source: mrdoob/three.js

The Lambert shader does not distinguishing between light sources for creating shadows, thus any light that creates a shadow blocks all lights in that area.

Exactly like the old issue with Phong materials, which has been fixed:
https://github.com/mrdoob/three.js/issues/6693
"Shadows should be applied only to shadow casting light."

Here's a screenshot of the Lambert and Phong materials and their shadows from two light sources, red and green:
https://imgur.com/gallery/zyuaf

The code:
https://codepen.io/SarahC/pen/zPjbdK/?editors=0010

Three.js version

R88?
https://cdnjs.cloudflare.com/ajax/libs/three.js/88/three.min.js

Browser

Tested in Chrome only.

OS

Tested on Windows only.

Hardware Requirements (graphics card, VR Device, ...)

Running on GTX970.

Most helpful comment

Balls..... yeah....

That is an expression I don't hear every day 馃榿

All 6 comments

Ah - limitation of the Lambert shader, thanks for pointing it out.

I'm happy to close the post. =)

Isn't the title of this post incorrect ?

Balls..... yeah.... I was thinking Lambert, and typed Phong.

It's been a loooooooooong week, and not enough coffee.

You understood what the title was supposed to be and linked to the relevant post. Impressive.

Balls..... yeah....

That is an expression I don't hear every day 馃榿

mrdoob, you're hanging with the wrong people. ;)

Was this page helpful?
0 / 5 - 0 ratings