Skip to content

Commit

Permalink
Disable depth mask (don't write to depth buffer) for 2nd shader, GH-8
Browse files Browse the repository at this point in the history
  • Loading branch information
deathcap committed Jun 15, 2014
1 parent 157d47a commit b5ca73f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aoshader.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ ShaderPlugin.prototype.render = function() {

//Bind the shader
// phase 1 - solid blocks
gl.depthMask(true)
gl.disable(gl.BLEND)
var shader = this.shader
if (!shader) throw new Error('voxel-shader render() called before gl-init, shader=', this.shader)
Expand Down Expand Up @@ -102,6 +103,7 @@ ShaderPlugin.prototype.render = function() {
}

// phase 2 - "porous" blocks
gl.depthMask(false)
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) // TODO: premult alpha? https://github.com/deathcap/voxel-stitch/issues/6
gl.enable(gl.BLEND)
var shader2 = this.shader2
Expand Down

0 comments on commit b5ca73f

Please sign in to comment.