-
Notifications
You must be signed in to change notification settings - Fork 1
/
Index.html
59 lines (49 loc) · 2 KB
/
Index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<html>
<head>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100%; }
* {cursor: none;}
</style>
</head>
<body>
<!-- ---------------- Custom Shader Code ------------------------ -->
<script id="vertexShader" type="x-shader/x-vertex">
uniform vec3 viewVector;
uniform float c;
uniform float p;
varying float intensity;
varying vec3 vNormal;
void main()
{
vNormal = normalize( normalMatrix * normal );
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
//vec3 vNormal1 = normalize( normalMatrix * normal );
//vec3 vNormal2 = normalize( normalMatrix * viewVector );
//intensity = pow( c - dot(vNormal1, vNormal2), p );
//gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
</script>
<!-- fragment shader a.k.a. pixel shader -->
<script id="fragmentShader" type="x-shader/x-vertex">
uniform vec3 glowColor;
varying float intensity;
varying vec3 vNormal;
void main()
{
float intensity = pow( 0.7 - dot( vNormal, vec3( 0.0, 0.0, 1.0 ) ), 4.0 );
gl_FragColor = vec4( 1.0, 1.0, 1.0, 1.0 ) * intensity;
//vec3 glow = glowColor * 0.5;
//gl_FragColor = vec4( glow, 1.0 );
}
</script>
<canvas id="render-canvas"></canvas>
<div style="position: fixed; top: 8px; left: 8px; color: white">Hit the F key to engage VR rendering</div>
<script src="js/three.min.js"></script>
<script src="http://threejs.org/examples/fonts/droid/droid_sans_regular.typeface.js"></script>
<script src="js/VRRenderer.js"></script>
<script src="js/jquery-2.1.3.js"></script>
<script src = "js/papaparse.js"></script>
<script src="js/HackDartmouth.js"></script>
</body>
</html>