summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/webgl/WebGLheader.html
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/base/webgl/WebGLheader.html')
-rw-r--r--Build/source/utils/asymptote/base/webgl/WebGLheader.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/Build/source/utils/asymptote/base/webgl/WebGLheader.html b/Build/source/utils/asymptote/base/webgl/WebGLheader.html
index 6eea5fd1be7..ac2f0839010 100644
--- a/Build/source/utils/asymptote/base/webgl/WebGLheader.html
+++ b/Build/source/utils/asymptote/base/webgl/WebGLheader.html
@@ -57,14 +57,22 @@ void main(void)
emissive=m.emissive;
} else {
diffuse=color;
+#if nlights > 0
emissive=vec4(0.0);
+#else
+ emissive=color;
+#endif
}
#else
m=Materials[int(materialIndex)];
#ifdef COLOR
diffuse=color;
+#if nlights > 0
emissive=vec4(0.0);
#else
+ emissive=color;
+#endif
+#else
diffuse=m.diffuse;
emissive=m.emissive;
#endif
@@ -155,7 +163,7 @@ varying vec4 emissive;
void main(void)
{
-#ifdef NORMAL
+#if defined(NORMAL) && nlights > 0
normal=normalize(Normal);
normal=gl_FrontFacing ? normal : -normal;
#ifdef ORTHOGRAPHIC
@@ -165,7 +173,7 @@ void main(void)
#endif
Roughness2=roughness*roughness;
vec3 color=emissive.rgb;
- for (int i=0; i < nLights; ++i) {
+ for(int i=0; i < nlights; ++i) {
Light Li=Lights[i];
vec3 L=Li.direction;
float cosTheta=max(dot(normal,L),0.0);