summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3d-webgl/client.js')
-rw-r--r--o3d/samples/o3d-webgl/client.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/o3d/samples/o3d-webgl/client.js b/o3d/samples/o3d-webgl/client.js
index cef816b..9d846c1 100644
--- a/o3d/samples/o3d-webgl/client.js
+++ b/o3d/samples/o3d-webgl/client.js
@@ -438,7 +438,17 @@ o3d.Client.prototype.render = function() {
this.render_callback(render_event);
}
this.then_ = now;
+
+ this.gl.colorMask(true, true, true, true);
+
this.renderTree(this.renderGraphRoot);
+
+ // When o3d finally draws to the webpage, the alpha channel should be all 1's
+ // So we clear with a color mask to set all alpha bytes to 1 before drawing.
+ // Before we draw again, the color mask gets set back to all true (above).
+ this.gl.colorMask(false, false, false, true);
+ this.gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ this.gl.clear(this.gl.COLOR_BUFFER_BIT);
};