Commits

Diego Cantor  committed 98a1382

Updating blending/culling. Thanks to Eric Haines

  • Participants
  • Parent commits 17690a2

Comments (0)

Files changed (2)

File 1727_07/ch7_Textured_Cube.html

                 gl.drawElements(gl.LINES, object.indices.length, gl.UNSIGNED_SHORT,0);
             }
             else{
+                gl.enable(gl.CULL_FACE);
+				gl.cullFace(gl.FRONT);
                 gl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT,0);
+				gl.cullFace(gl.BACK);
+                gl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT,0);
+ 				gl.disable(gl.CULL_FACE);
             }
 			
             gl.bindBuffer(gl.ARRAY_BUFFER, null);

File 1727_07/ch7_Textured_Cube_Finished.html

                 gl.drawElements(gl.LINES, object.indices.length, gl.UNSIGNED_SHORT,0);
             }
             else{
+                gl.enable(gl.CULL_FACE);
+				gl.cullFace(gl.FRONT);
                 gl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT,0);
+				gl.cullFace(gl.BACK);
+                gl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT,0);
+ 				gl.disable(gl.CULL_FACE);
             }
 			
             gl.bindBuffer(gl.ARRAY_BUFFER, null);