Turn off lighting for VR
This commit is contained in:
parent
3af3635eea
commit
2b0b699fa0
|
@ -719,7 +719,7 @@ class ThreeDRenderer extends Renderer {
|
|||
normal[0] / normal[3],
|
||||
normal[1] / normal[3],
|
||||
normal[2] / normal[3]);
|
||||
|
||||
gl.uniform1f(monumentProgram.uniforms.uLightThings, this.inVR ? 0 : 1);
|
||||
// Draw the face!
|
||||
gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, face * 6 * UINT16_SIZE);
|
||||
}
|
||||
|
|
|
@ -25,12 +25,17 @@ uniform float uShininess;
|
|||
/// The normal of these vertices.
|
||||
uniform vec3 uNormal;
|
||||
|
||||
uniform bool uLightThings;
|
||||
|
||||
varying vec3 vPosition;
|
||||
|
||||
void main() {
|
||||
vec3 normal = normalize(uNormal);
|
||||
vec3 lightDirection = normalize(uLightPosition - vPosition);
|
||||
|
||||
vec3 color = uAmbientColor;
|
||||
|
||||
if (uLightThings) {
|
||||
float lambertian = max(dot(lightDirection, normal), 0.0);
|
||||
float specular = 0.0;
|
||||
|
||||
|
@ -41,6 +46,7 @@ void main() {
|
|||
specular = pow(specularAngle, uShininess);
|
||||
}
|
||||
|
||||
vec3 color = uAmbientColor + lambertian * uDiffuseColor + specular * uSpecularColor;
|
||||
color = color + uAmbientColor + lambertian * uDiffuseColor + specular * uSpecularColor;
|
||||
}
|
||||
gl_FragColor = vec4(color, 1.0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue