Removed margin.
3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4 <title>Machine Alpha</title>
5 <style type="text/css">
8 <script language="javascript" src="scripts/boot.js"></script>
9 <script id="fragment-shader" type="x-shader/x-fragment">
11 precision highp float;
15 varying vec3 vLightWeighting;
19 gl_FragColor = vec4(vColour.rgb * vLightWeighting, vColour.a);
23 <script id="vertex-shader" type="x-shader/x-vertex">
24 attribute vec3 aVertexPosition;
25 attribute vec3 aVertexNormal;
26 attribute vec4 aVertexColour;
28 uniform mat4 uMVMatrix;
29 uniform mat4 uPMatrix;
30 uniform mat3 uNMatrix;
32 uniform vec3 uAmbientColour;
33 uniform vec3 uLightingDirection;
34 uniform vec3 uDirectionalColour;
36 uniform bool uUseLighting;
39 varying vec3 vLightWeighting;
43 gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
44 vColour = aVertexColour;
48 vLightWeighting = vec3(1.0, 1.0, 1.0);
52 vec3 transformedNormal = uNMatrix * aVertexNormal;
53 float directionalLightWeighting = max(dot(transformedNormal, uLightingDirection), 0.0);
54 vLightWeighting = uAmbientColour + uDirectionalColour * directionalLightWeighting;
60 <body onload="boot();">
62 Download a browser with WebGL support, like Chrome or Firefox.