-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (93 loc) · 3.15 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<html>
<head>
<meta charset="utf-8">
<script src="./webgl-obj-loader.js"></script>
<script src="utility.js"></script>
<script src="utils.js"></script>
<script src="./src/scripts/synthmon-core.js"></script>
<script src="./src/scripts/synthmon-gui.js"></script>
<script src="./src/scripts/synthmon-components.js"></script>
<script src="./src/scripts/synthmon-components-world.js"></script>
<script src="./src/scripts/synthmon-components-battle.js"></script>
<script src="./src/scripts/synthmon-system-loading.js"></script>
<script src="./src/scripts/synthmon-system-main_menu.js"></script>
<script src="./src/scripts/synthmon-system-world.js"></script>
<script src="./src/scripts/synthmon-system-battle.js"></script>
<script src="./src/scripts/synthmon-assemblages.js"></script>
<script src="./src/scripts/synthmon-controllers.js"></script>
<script src="./src/scripts/synthmon-objects.js"></script>
<script src="./src/scripts/synthmon-webgl.js"></script>
<script src="./src/scripts/synthmon-main.js"></script>
<script name="lambertFragShader" id="lambert-fs" type="x-shader/x-fragment">
precision highp float;
uniform sampler2D u_sampler;
varying vec2 v_uvCoord;
varying vec3 v_vertNorm;
varying float DEPTH ;
void main(void) {
vec4 a = texture2D(u_sampler, vec2(v_uvCoord.x, v_uvCoord.y));
//gl_FragColor = vec4(x1, y1, 0.0, 1.0);
gl_FragColor = a;
//vec3 ambientLight = vec3(0.25, 0.25, 0.25);
//vec3 directionalLightColor = vec3(0.75, 0.75, 0.75);
//vec3 directionalVector = vec3(0.85, 0.8, 0.75);
//float directional = max(dot(v_vertNorm.xyz, directionalVector), 0.0);
//vec4 phong_thing = vec4(ambientLight + (directionalLightColor * directional), 1.0);
//vec4 a = texture2D(u_sampler, vec2(v_uvCoord.x,v_uvCoord.y * -1.0));
//gl_FragColor = vec4(a.x * phong_thing.x - DEPTH / 4.0, a.y * phong_thing.y - DEPTH / 4.0, a.z * phong_thing.z - DEPTH / 4.0, 1.0);
}
</script>
<script name="lambertVertShader" id="lambert-vs" type="x-shader/x-vertex">
precision highp float;
attribute vec3 a_vertPos;
attribute vec2 a_uvCoord;
attribute vec3 a_vertNorm;
uniform mat4 u_mMatrix;
uniform mat4 u_pMatrix;
uniform mat4 u_vMatrix;
uniform mat4 u_nMatrix;
varying vec2 v_uvCoord;
varying vec3 v_vertNorm;
varying float DEPTH;
varying vec4 ShadowCoord;
void main(void) {
gl_Position = u_pMatrix * u_vMatrix * u_mMatrix * vec4(a_vertPos, 1.0);
v_uvCoord = a_uvCoord;
//DEPTH = gl_Position.z / 64.0 ;
//vec4 transformedNormal = u_nMatrix * vec4(a_vertNorm, 1.0);
v_vertNorm = a_vertNorm;
}
</script>
</head>
<body onload="init()">
<canvas id="game"></canvas>
<div id="system0"></div>
<div id="system1"></div>
<div id="system2"></div>
<div id="system3"></div>
<div id="system4"></div>
</body>
</html>
<style>
* {
margin: 0;
}
body {
text-align:center;
}
canvas {
margin: 0 auto;
}
#gui {
position:absolute;
margin:0 auto;
}
#gui .container {
padding:4px;
border: 1px black solid;
background-color: rgba(0, 0, 0, 0.125);
}
div {
font-family: "Courier New", Courier, monospace;
}
</style>