diff --git a/index.html b/index.html index b0ed9b4..a59b1ce 100644 --- a/index.html +++ b/index.html @@ -111,7 +111,7 @@ uniform sampler2D uSampler; lcolor += diffuse * max(0., dot(N, LDir)) * LCol; //*SPECULAR LIGHTS ARE ADDED specularlight = specular * - max(0., pow(dot(2.*dot(N, LDir) * N - LDir, VDir),3.)) * LCol; + pow(max(0.,dot(2.*dot(N, LDir) * N - LDir, VDir)),3.) * LCol; // ROTATE THE TEXTURE OVER TIME. float angle = 0.4 * uTime; @@ -206,7 +206,7 @@ uniform sampler2D uSampler; lcolor += 1.2*diffuse * max(0., dot(N, LDir)) * LCol; specularlight = 0.3*specular * - max(0., pow(dot(2.*dot(N, LDir) * N - LDir, VDir),32.)) * LCol; + pow(max(0., dot(2.*dot(N, LDir) * N - LDir, VDir)),32.) * LCol; color = color * lcolor + specularlight; } @@ -247,12 +247,12 @@ that you are seeing now.
diff --git a/lib1.js b/lib1.js index 33a7345..0239dc7 100644 --- a/lib1.js +++ b/lib1.js @@ -77,7 +77,7 @@ function gl_start(canvas, vertexShader, fragmentShader) { // START WEB setTimeout(function () { try { - canvas.gl = canvas.getContext('experimental-webgl'); // Make sure WebGl is supported. IT WOULD BE GREAT TO USE WEBGL2 INSTEAD. + canvas.gl = canvas.getContext('webgl2'); // Make sure WebGl is supported. IT WOULD BE GREAT TO USE WEBGL2 INSTEAD. } catch (e) { throw 'Sorry, your browser does not support WebGL.'; } canvas.setShaders = function (vertexShader, fragmentShader) { // Add the vertex and fragment shaders: