Set diffuse to black when constant lighting is used

This commit is contained in:
Sean Lilley 2017-03-14 12:06:50 -04:00
parent 5d0511b6a0
commit d46d58fdc5

View File

@ -90,6 +90,7 @@ function createGltf(objData) {
if (!hasNormals) { if (!hasNormals) {
// Constant technique only factors in ambient and emission sources - set emission to diffuse // Constant technique only factors in ambient and emission sources - set emission to diffuse
emission = diffuse; emission = diffuse;
diffuse = [0, 0, 0, 1];
} }
var technique = hasNormals ? (hasSpecular ? 'PHONG' : 'LAMBERT') : 'CONSTANT'; var technique = hasNormals ? (hasSpecular ? 'PHONG' : 'LAMBERT') : 'CONSTANT';