You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In dwgl.js the uniformT function does not work when you try to pass more than 1 texture as uniforms to a fragment shader. I have discovered the fix. You need to make the texture active BEFORE you bind it. The fixed function is below. The two lines that need to be switched are the gl.activeTexture and gl.bindTexture lines, which currently are lines 630 and 631 in dwgl.js.
FIXED FUNCTION:
uniformT(name,val){vargl=this.gl;varloc=this.uniformLoc(name);if(loc){gl.activeTexture(gl.TEXTURE0+this.tex_loc);// these are the two linesgl.bindTexture(gl.TEXTURE_2D,val);// that needed to be switched gl.uniform1i(loc,this.tex_loc);this.tex_loc++;}}
The text was updated successfully, but these errors were encountered:
In
dwgl.js
theuniformT
function does not work when you try to pass more than 1 texture as uniforms to a fragment shader. I have discovered the fix. You need to make the texture active BEFORE you bind it. The fixed function is below. The two lines that need to be switched are thegl.activeTexture
andgl.bindTexture
lines, which currently are lines 630 and 631 indwgl.js
.FIXED FUNCTION:
The text was updated successfully, but these errors were encountered: