├── .gitignore
├── LICENSE
├── build.js
├── check
├── package-lock.json
├── package.json
├── rollup.config.js
├── src
├── definitions.json
├── glConsts.ts
├── index.debug.html
├── index.release.html
├── index.ts
├── main.frag
├── main.vert
├── post.frag
├── sdfDefs.hlsl
└── synth.ts
├── tools
├── shader_minifier.exe
└── shader_minifier.txt
├── trackEditor
├── .gitignore
├── Assets
│ ├── 00-TitleTrack.unity
│ ├── 00-TitleTrack.unity.meta
│ ├── 01-Track1.unity
│ ├── 01-Track1.unity.meta
│ ├── 01-test.unity
│ ├── 01-test.unity.meta
│ ├── 02-Track2.unity
│ ├── 02-Track2.unity.meta
│ ├── 03-Track3.unity
│ ├── 03-Track3.unity.meta
│ ├── 04-Track4.unity
│ ├── 04-Track4.unity.meta
│ ├── 05-Track5.unity
│ ├── 05-Track5.unity.meta
│ ├── 06-Track6.unity
│ ├── 06-Track6.unity.meta
│ ├── 07-Track7.unity
│ ├── 07-Track7.unity.meta
│ ├── 08-Track8.unity
│ ├── 08-Track8.unity.meta
│ ├── Checkpoint.prefab
│ ├── Checkpoint.prefab.meta
│ ├── Cork.prefab
│ ├── Cork.prefab.meta
│ ├── FirstPersonRegion.prefab
│ ├── FirstPersonRegion.prefab.meta
│ ├── PreviewCamera.prefab
│ ├── PreviewCamera.prefab.meta
│ ├── Scripts.meta
│ ├── Scripts
│ │ ├── Editor.meta
│ │ ├── Editor
│ │ │ ├── MapObjectEditor.cs
│ │ │ └── MapObjectEditor.cs.meta
│ │ ├── MapCheckpoint.cs
│ │ ├── MapCheckpoint.cs.meta
│ │ ├── MapCompiler.cs
│ │ ├── MapCompiler.cs.meta
│ │ ├── MapEditorCamera.cs
│ │ ├── MapEditorCamera.cs.meta
│ │ ├── MapFirstPersonRegion.cs
│ │ ├── MapFirstPersonRegion.cs.meta
│ │ ├── MapObject.cs
│ │ ├── MapObject.cs.meta
│ │ ├── MapObjectSmoothJoin.cs
│ │ ├── MapObjectSmoothJoin.cs.meta
│ │ ├── Utils.cs
│ │ └── Utils.cs.meta
│ ├── Shaders.meta
│ └── Shaders
│ │ ├── PreviewMarcher.mat
│ │ ├── PreviewMarcher.mat.meta
│ │ ├── PreviewMarcher.shader
│ │ ├── PreviewMarcher.shader.meta
│ │ ├── trackData.gen.cginc
│ │ └── trackData.gen.cginc.meta
├── Packages
│ └── manifest.json
└── ProjectSettings
│ ├── AudioManager.asset
│ ├── ClusterInputManager.asset
│ ├── DynamicsManager.asset
│ ├── EditorBuildSettings.asset
│ ├── EditorSettings.asset
│ ├── GraphicsSettings.asset
│ ├── InputManager.asset
│ ├── NavMeshAreas.asset
│ ├── Physics2DSettings.asset
│ ├── PresetManager.asset
│ ├── ProjectSettings.asset
│ ├── ProjectVersion.txt
│ ├── QualitySettings.asset
│ ├── TagManager.asset
│ ├── TimeManager.asset
│ ├── UnityConnectSettings.asset
│ ├── VFXManager.asset
│ └── XRSettings.asset
├── tracks
├── track00.glsl
├── track01.glsl
├── track02.glsl
├── track03.glsl
├── track04.glsl
├── track05.glsl
├── track06.glsl
├── track07.glsl
└── track08.glsl
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | build/
3 | out.zip
4 | src/*.gen.ts
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Jeremy Burns
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/build.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | const sh = require('shelljs');
3 | const fs = require('fs');
4 | const path = require('path');
5 | const _ = require('lodash');
6 | const ShapeShifter = require('regpack/shapeShifter');
7 | const advzipPath = require('advzip-bin');
8 | const definitionsJson = require('./src/definitions.json');
9 |
10 | const DEBUG = process.argv.indexOf('--debug') >= 0;
11 | const MONO_RUN = process.platform === 'win32' ? '' : 'mono ';
12 |
13 | const g_shaderExternalNameMap = {};
14 |
15 | const run = cmd =>
16 | {
17 | const code = sh.exec( cmd ).code;
18 | if( code !== 0 )
19 | process.exit( code );
20 | };
21 |
22 | const replaceSimple = (x, y, z) =>
23 | {
24 | const idx = x.indexOf( y );
25 | if( idx < 0 ) return x;
26 | return x.substr( 0, idx ) + z + x.substr( idx + y.length );
27 | };
28 |
29 | const applyStateMap = code =>
30 | {
31 | for( let k in definitionsJson.constants )
32 | code = code.replace( new RegExp( k, 'g' ), definitionsJson.constants[k] );
33 |
34 | for( let i in definitionsJson.stateFields )
35 | code = code.replace( new RegExp( definitionsJson.stateFields[i], 'g' ), i );
36 |
37 | return code;
38 | };
39 |
40 | const hashWebglIdentifiers = ( js, and2dContext ) =>
41 | {
42 | let result = new ShapeShifter().preprocess(js, {
43 | hashWebGLContext: true,
44 | contextVariableName: 'g',
45 | contextType: 1,
46 | reassignVars: true,
47 | varsNotReassigned: ['A','b','g','c'],
48 | useES6: true,
49 | })[2].contents;
50 |
51 | result = result.replace('for(', 'for(let ');
52 |
53 | if( and2dContext )
54 | {
55 | result = new ShapeShifter().preprocess(result, {
56 | hash2DContext: true,
57 | contextVariableName: 'c',
58 | contextType: 0,
59 | reassignVars: true,
60 | varsNotReassigned: ['A','b','g','c'],
61 | useES6: true,
62 | })[2].contents;
63 |
64 | result = result.replace('for(', 'for(let ');
65 | }
66 |
67 | return result;
68 | };
69 |
70 | const buildShaderExternalNameMap = shaderCode =>
71 | {
72 | let i = 0;
73 | _.uniq( shaderCode.match(/[vau]_[a-zA-Z0-9]+/g) )
74 | .forEach( x => g_shaderExternalNameMap[x] = `x${i++}` );
75 | };
76 |
77 | const minifyShaderExternalNames = code =>
78 | {
79 | for( let k in g_shaderExternalNameMap )
80 | code = code.replace( new RegExp( k, 'g' ), g_shaderExternalNameMap[k] );
81 |
82 | return code;
83 | };
84 |
85 | const convertStateAccessNotation = shaderCode =>
86 | {
87 | // i.e. ST.wheelPos[2] -> g_state[s_wheelPos2];
88 | // ST.wheelLastPos[i] -> g_state[s_wheelLastPos0 + i * s_wheelStructSize ];
89 |
90 | let match;
91 | while( match = shaderCode.match( /ST\.[a-zA-Z0-9\[\]]+/ ))
92 | {
93 | const str = match[0];
94 | let newStr = str;
95 |
96 | if( str.endsWith(']'))
97 | {
98 | const idx = str.match(/\[(.+)\]/)[1];
99 | const propName = str.replace('ST.', '').replace(/\[.*/, '');
100 | const structName = propName.match(/^[a-z]+/)[0];
101 |
102 | if( isNaN( parseInt( idx )))
103 | newStr = `g_state[s_${propName}0 + ${idx} * s_${structName}StructSize]`;
104 | else
105 | newStr = `g_state[s_${propName}${idx}]`;
106 | }
107 | else
108 | {
109 | const propName = str.replace('ST.', '');
110 | newStr = `g_state[s_${propName}]`;
111 | }
112 |
113 | shaderCode = shaderCode.substr( 0, match.index ) + newStr + shaderCode.substr( match.index + str.length );
114 | }
115 |
116 | return shaderCode;
117 | };
118 |
119 | const convertHLSLtoGLSL = hlsl =>
120 | {
121 | const glslOverride = '//GLSL//';
122 |
123 | let lines = hlsl
124 | .replace(/float3x3/g, 'mat3')
125 | .replace(/float2x2/g, 'mat2')
126 | .replace(/float2/g, 'vec2')
127 | .replace(/float3/g, 'vec3')
128 | .replace(/float4/g, 'vec4')
129 | .replace(/lerp/g, 'mix')
130 | .replace(/frac/g, 'fract')
131 | .replace(/atan2/g, 'atan')
132 | .replace(/transpose_hlsl_only/g, '')
133 | .replace(/static /g, '')
134 | .split('\n');
135 |
136 | lines = lines.map( x =>
137 | {
138 | const idx = x.indexOf(glslOverride);
139 | return idx >= 0
140 | ? x.substr( idx + glslOverride.length )
141 | : x;
142 | });
143 |
144 | return lines.join('\n');
145 | }
146 |
147 | const insertWorldSDFCode = shaderCode =>
148 | {
149 | const sdfDefs = convertHLSLtoGLSL( fs.readFileSync( 'src/sdfDefs.hlsl', 'utf8' ));
150 | const tracks = sh.ls( 'tracks' )
151 | .map( x => '#ifdef T' + x.replace(/[^0-9]/g, '') + '\n' + fs.readFileSync( 'tracks/' + x, 'utf8' ) + '\n' + '#endif' )
152 | .join('\n')
153 | .split('\n')
154 | .map( x => x.trim().startsWith('const') ? '' : x )
155 | .join('\n');
156 |
157 | return shaderCode.replace( '#pragma INCLUDE_WORLD_SDF', sdfDefs + '\n' + tracks + '\n' );
158 | };
159 |
160 | const preprocessShader = shaderCode =>
161 | applyStateMap( convertStateAccessNotation( insertWorldSDFCode( shaderCode )));
162 |
163 | const reinsertTrackConstants = shaderGenTS =>
164 | {
165 | const lines = shaderGenTS.split('\n');
166 |
167 | sh.ls( 'tracks' ).forEach( x =>
168 | {
169 | const trackId = x.replace(/[^0-9]/g, '');
170 | const consts = fs.readFileSync( 'tracks/' + x, 'utf8' )
171 | .split('\n')
172 | .filter( x => x.trim().startsWith('const') )
173 | .map( x => '"' + x + '" +' )
174 | .join('\n');
175 |
176 | for( let i = 0; i < lines.length; ++i )
177 | {
178 | if( lines[i].indexOf('T'+trackId) >= 0 )
179 | {
180 | lines.splice( i+1, 0, consts );
181 | break;
182 | }
183 | }
184 | });
185 |
186 | return lines.join('\n');
187 | }
188 |
189 | const generateShaderFile = () =>
190 | {
191 | sh.mkdir( '-p', 'shadersTmp' );
192 | sh.ls( 'src' ).forEach( x =>
193 | {
194 | if( x.endsWith('.frag') || x.endsWith('.vert'))
195 | {
196 | const code = fs.readFileSync( path.resolve( 'src', x ), 'utf8' );
197 | fs.writeFileSync( path.resolve( 'shadersTmp', x ), preprocessShader( code ));
198 | }
199 | });
200 |
201 | let noRenames = ['main','Xm','Xt'];
202 | // noRenames = noRenames.concat([0,1,2,3].flatMap(x => (['Xc'+x, 'Xf'+x])));
203 | // noRenames = noRenames.concat([0].map(x => (['Xp'+x])));
204 |
205 | run( MONO_RUN + 'tools/shader_minifier.exe --no-renaming-list '+noRenames.join(',')+' --format js -o build/shaders.js --preserve-externals '+(DEBUG ? '--preserve-all-globals' : '')+' shadersTmp/*' );
206 | let shaderCode = fs.readFileSync('build/shaders.js', 'utf8');
207 | buildShaderExternalNameMap( shaderCode );
208 | shaderCode = minifyShaderExternalNames( shaderCode );
209 |
210 | shaderCode = shaderCode
211 | .split('\n')
212 | .map( x => x.replace(/^var/, 'export let'))
213 | .join('\n');
214 |
215 | shaderCode = reinsertTrackConstants( shaderCode );
216 |
217 | if( DEBUG )
218 | shaderCode = shaderCode.replace(/" \+/g, '\\n" +');
219 |
220 | fs.writeFileSync( 'src/shaders.gen.ts', shaderCode );
221 |
222 | sh.rm( '-rf', 'shadersTmp' );
223 | };
224 |
225 | const wrapWithHTML = js =>
226 | {
227 | let htmlTemplate = fs.readFileSync( DEBUG ? 'src/index.debug.html' : 'src/index.release.html', 'utf8' );
228 |
229 | if( !DEBUG ) htmlTemplate = htmlTemplate
230 | .split('\n')
231 | .map( line => line.trim() )
232 | .join('')
233 | .trim();
234 |
235 | return replaceSimple(htmlTemplate, '__CODE__', js.trim());
236 | };
237 |
238 | const main = () =>
239 | {
240 | definitionsJson.constants.s_totalStateSize = definitionsJson.stateFields.length;
241 | definitionsJson.constants.s_totalStateSizeX4 = 4 * definitionsJson.stateFields.length;
242 |
243 | sh.cd( __dirname );
244 | sh.mkdir( '-p', 'build' );
245 |
246 | fs.writeFileSync( 'src/debug.gen.ts', `export const DEBUG = ${DEBUG ? 'true' : 'false'};\n` );
247 |
248 | console.log('Minifying shaders...');
249 | generateShaderFile();
250 | console.log('Compiling typescript...');
251 | run( 'tsc --outDir build' );
252 | console.log('Rolling up bundle...');
253 | run( 'rollup -c' + ( DEBUG ? ' --config-debug' : '' ));
254 |
255 | let x = fs.readFileSync('build/bundle.js', 'utf8');
256 | x = minifyShaderExternalNames( x );
257 | if( !DEBUG ) x = hashWebglIdentifiers( x, true );
258 | x = wrapWithHTML( x );
259 | x = applyStateMap( x );
260 | fs.writeFileSync( 'build/index.html', x );
261 |
262 | if( !DEBUG )
263 | {
264 | run( advzipPath + ' --shrink-insane -i 10 -a out.zip build/index.html' );
265 |
266 | const zipStat = fs.statSync('out.zip');
267 | const percent = Math.floor((zipStat.size / 13312) * 100);
268 | console.log('');
269 | console.log(` Final bundle size: ${zipStat.size} / 13312 bytes (${percent} %)`);
270 | console.log('');
271 | }
272 | };
273 |
274 | main();
275 |
--------------------------------------------------------------------------------
/check:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | curl -X POST \
4 | --form bundle=@out.zip \
5 | --form category=desktop \
6 | https://iw8sii1h9b.execute-api.eu-west-1.amazonaws.com/stage/analyze-bundle \
7 | | jq
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "js13k2020",
3 | "private": true,
4 | "scripts": {
5 | "debug": "node build.js --debug",
6 | "start": "node build.js"
7 | },
8 | "devDependencies": {
9 | "advzip-bin": "2.0.0",
10 | "lodash": "4.17.20",
11 | "regpack": "Siorki/RegPack#v5.0.3",
12 | "rollup": "2.26.4",
13 | "rollup-plugin-terser": "7.0.0",
14 | "shelljs": "0.8.4",
15 | "typescript": "3.9.7"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import { terser } from 'rollup-plugin-terser';
2 |
3 | const DEBUG = process.argv.indexOf( '--config-debug' ) >= 0;
4 |
5 | export default {
6 | input: 'build/index.js',
7 | output: {
8 | file: 'build/bundle.js',
9 | strict: false,
10 | },
11 | plugins: DEBUG ? [] : [ terser({
12 | ecma: 2020,
13 | compress: {
14 | passes: 10,
15 | keep_fargs: false,
16 | pure_getters: true,
17 | unsafe: true,
18 | unsafe_arrows: true,
19 | unsafe_comps: true,
20 | unsafe_math: true,
21 | unsafe_methods: true,
22 | unsafe_symbols: true,
23 | },
24 | mangle: {
25 | reserved: ['C0','C1','g','c'],
26 | properties: {
27 | keep_quoted: true
28 | },
29 | },
30 | format: {
31 | quote_style: 1
32 | },
33 | })]
34 | };
--------------------------------------------------------------------------------
/src/definitions.json:
--------------------------------------------------------------------------------
1 | {
2 | "constants": {
3 | "s_totalStateSize": "¯\\_(ツ)_/¯",
4 | "s_totalStateSizeX4": "¯\\_(ツ)_/¯",
5 |
6 | "s_wheelBaseWidth": 1.6,
7 | "s_wheelBaseLength": 2,
8 | "s_wheelRadius": 0.4,
9 | "s_gravity": 20,
10 |
11 | "s_ticksPerSecond": 30,
12 | "s_sqrTicksPerSecond": 900,
13 | "s_millisPerTick": 33.3,
14 |
15 | "s_fullWidth": 1024,
16 | "s_fullHeight": 768,
17 | "s_renderWidth": 512,
18 | "s_renderHeight": 384,
19 |
20 | "s_audioBufferSize": 1024,
21 | "s_audioSampleRate": 22050,
22 | "s_tempo": 0.45,
23 |
24 | "s_wheelStructSize": 4
25 | },
26 | "/*": [
27 | "s_carState.x => current steering angle",
28 | "s_carState.y => current car speed",
29 | "s_carState.z => 1 -> car is not flipped, -1 -> car is flipped",
30 | "s_goalStateA/B.xyz => checkpoint state, -1/1 -> not cleared, holds which side we're on. 2 -> cleared",
31 | "s_goalStateB.y => 1 -> touching the purple grid",
32 | "s_wheelRotationX => x rotation, y angular velocity, z 0/1 is wheel touching ground"
33 | ],
34 | "stateFields": [
35 | "s_carState",
36 | "s_goalStateA",
37 | "s_goalStateB",
38 | "s_wheelPos0",
39 | "s_wheelLastPos0",
40 | "s_wheelForceCache0",
41 | "s_wheelRotation0",
42 | "s_wheelPos1",
43 | "s_wheelLastPos1",
44 | "s_wheelForceCache1",
45 | "s_wheelRotation1",
46 | "s_wheelPos2",
47 | "s_wheelLastPos2",
48 | "s_wheelForceCache2",
49 | "s_wheelRotation2",
50 | "s_wheelPos3",
51 | "s_wheelLastPos3",
52 | "s_wheelForceCache3",
53 | "s_wheelRotation3"
54 | ]
55 | }
--------------------------------------------------------------------------------
/src/glConsts.ts:
--------------------------------------------------------------------------------
1 | export const gl_DEPTH_BUFFER_BIT = 256;
2 | export const gl_STENCIL_BUFFER_BIT = 1024;
3 | export const gl_COLOR_BUFFER_BIT = 16384;
4 | export const gl_POINTS = 0;
5 | export const gl_LINES = 1;
6 | export const gl_LINE_LOOP = 2;
7 | export const gl_LINE_STRIP = 3;
8 | export const gl_TRIANGLES = 4;
9 | export const gl_TRIANGLE_STRIP = 5;
10 | export const gl_TRIANGLE_FAN = 6;
11 | export const gl_ZERO = 0;
12 | export const gl_ONE = 1;
13 | export const gl_SRC_COLOR = 768;
14 | export const gl_ONE_MINUS_SRC_COLOR = 769;
15 | export const gl_SRC_ALPHA = 770;
16 | export const gl_ONE_MINUS_SRC_ALPHA = 771;
17 | export const gl_DST_ALPHA = 772;
18 | export const gl_ONE_MINUS_DST_ALPHA = 773;
19 | export const gl_DST_COLOR = 774;
20 | export const gl_ONE_MINUS_DST_COLOR = 775;
21 | export const gl_SRC_ALPHA_SATURATE = 776;
22 | export const gl_FUNC_ADD = 32774;
23 | export const gl_BLEND_EQUATION = 32777;
24 | export const gl_BLEND_EQUATION_RGB = 32777;
25 | export const gl_BLEND_EQUATION_ALPHA = 34877;
26 | export const gl_FUNC_SUBTRACT = 32778;
27 | export const gl_FUNC_REVERSE_SUBTRACT = 32779;
28 | export const gl_BLEND_DST_RGB = 32968;
29 | export const gl_BLEND_SRC_RGB = 32969;
30 | export const gl_BLEND_DST_ALPHA = 32970;
31 | export const gl_BLEND_SRC_ALPHA = 32971;
32 | export const gl_CONSTANT_COLOR = 32769;
33 | export const gl_ONE_MINUS_CONSTANT_COLOR = 32770;
34 | export const gl_CONSTANT_ALPHA = 32771;
35 | export const gl_ONE_MINUS_CONSTANT_ALPHA = 32772;
36 | export const gl_BLEND_COLOR = 32773;
37 | export const gl_ARRAY_BUFFER = 34962;
38 | export const gl_ELEMENT_ARRAY_BUFFER = 34963;
39 | export const gl_ARRAY_BUFFER_BINDING = 34964;
40 | export const gl_ELEMENT_ARRAY_BUFFER_BINDING = 34965;
41 | export const gl_STREAM_DRAW = 35040;
42 | export const gl_STATIC_DRAW = 35044;
43 | export const gl_DYNAMIC_DRAW = 35048;
44 | export const gl_BUFFER_SIZE = 34660;
45 | export const gl_BUFFER_USAGE = 34661;
46 | export const gl_CURRENT_VERTEX_ATTRIB = 34342;
47 | export const gl_FRONT = 1028;
48 | export const gl_BACK = 1029;
49 | export const gl_FRONT_AND_BACK = 1032;
50 | export const gl_TEXTURE_2D = 3553;
51 | export const gl_CULL_FACE = 2884;
52 | export const gl_BLEND = 3042;
53 | export const gl_DITHER = 3024;
54 | export const gl_STENCIL_TEST = 2960;
55 | export const gl_DEPTH_TEST = 2929;
56 | export const gl_SCISSOR_TEST = 3089;
57 | export const gl_POLYGON_OFFSET_FILL = 32823;
58 | export const gl_SAMPLE_ALPHA_TO_COVERAGE = 32926;
59 | export const gl_SAMPLE_COVERAGE = 32928;
60 | export const gl_NO_ERROR = 0;
61 | export const gl_INVALID_ENUM = 1280;
62 | export const gl_INVALID_VALUE = 1281;
63 | export const gl_INVALID_OPERATION = 1282;
64 | export const gl_OUT_OF_MEMORY = 1285;
65 | export const gl_CW = 2304;
66 | export const gl_CCW = 2305;
67 | export const gl_LINE_WIDTH = 2849;
68 | export const gl_ALIASED_POINT_SIZE_RANGE = 33901;
69 | export const gl_ALIASED_LINE_WIDTH_RANGE = 33902;
70 | export const gl_CULL_FACE_MODE = 2885;
71 | export const gl_FRONT_FACE = 2886;
72 | export const gl_DEPTH_RANGE = 2928;
73 | export const gl_DEPTH_WRITEMASK = 2930;
74 | export const gl_DEPTH_CLEAR_VALUE = 2931;
75 | export const gl_DEPTH_FUNC = 2932;
76 | export const gl_STENCIL_CLEAR_VALUE = 2961;
77 | export const gl_STENCIL_FUNC = 2962;
78 | export const gl_STENCIL_FAIL = 2964;
79 | export const gl_STENCIL_PASS_DEPTH_FAIL = 2965;
80 | export const gl_STENCIL_PASS_DEPTH_PASS = 2966;
81 | export const gl_STENCIL_REF = 2967;
82 | export const gl_STENCIL_VALUE_MASK = 2963;
83 | export const gl_STENCIL_WRITEMASK = 2968;
84 | export const gl_STENCIL_BACK_FUNC = 34816;
85 | export const gl_STENCIL_BACK_FAIL = 34817;
86 | export const gl_STENCIL_BACK_PASS_DEPTH_FAIL = 34818;
87 | export const gl_STENCIL_BACK_PASS_DEPTH_PASS = 34819;
88 | export const gl_STENCIL_BACK_REF = 36003;
89 | export const gl_STENCIL_BACK_VALUE_MASK = 36004;
90 | export const gl_STENCIL_BACK_WRITEMASK = 36005;
91 | export const gl_VIEWPORT = 2978;
92 | export const gl_SCISSOR_BOX = 3088;
93 | export const gl_COLOR_CLEAR_VALUE = 3106;
94 | export const gl_COLOR_WRITEMASK = 3107;
95 | export const gl_UNPACK_ALIGNMENT = 3317;
96 | export const gl_PACK_ALIGNMENT = 3333;
97 | export const gl_MAX_TEXTURE_SIZE = 3379;
98 | export const gl_MAX_VIEWPORT_DIMS = 3386;
99 | export const gl_SUBPIXEL_BITS = 3408;
100 | export const gl_RED_BITS = 3410;
101 | export const gl_GREEN_BITS = 3411;
102 | export const gl_BLUE_BITS = 3412;
103 | export const gl_ALPHA_BITS = 3413;
104 | export const gl_DEPTH_BITS = 3414;
105 | export const gl_STENCIL_BITS = 3415;
106 | export const gl_POLYGON_OFFSET_UNITS = 10752;
107 | export const gl_POLYGON_OFFSET_FACTOR = 32824;
108 | export const gl_TEXTURE_BINDING_2D = 32873;
109 | export const gl_SAMPLE_BUFFERS = 32936;
110 | export const gl_SAMPLES = 32937;
111 | export const gl_SAMPLE_COVERAGE_VALUE = 32938;
112 | export const gl_SAMPLE_COVERAGE_INVERT = 32939;
113 | export const gl_COMPRESSED_TEXTURE_FORMATS = 34467;
114 | export const gl_DONT_CARE = 4352;
115 | export const gl_FASTEST = 4353;
116 | export const gl_NICEST = 4354;
117 | export const gl_GENERATE_MIPMAP_HINT = 33170;
118 | export const gl_BYTE = 5120;
119 | export const gl_UNSIGNED_BYTE = 5121;
120 | export const gl_SHORT = 5122;
121 | export const gl_UNSIGNED_SHORT = 5123;
122 | export const gl_INT = 5124;
123 | export const gl_UNSIGNED_INT = 5125;
124 | export const gl_FLOAT = 5126;
125 | export const gl_DEPTH_COMPONENT = 6402;
126 | export const gl_ALPHA = 6406;
127 | export const gl_RGB = 6407;
128 | export const gl_RGBA = 6408;
129 | export const gl_LUMINANCE = 6409;
130 | export const gl_LUMINANCE_ALPHA = 6410;
131 | export const gl_UNSIGNED_SHORT_4_4_4_4 = 32819;
132 | export const gl_UNSIGNED_SHORT_5_5_5_1 = 32820;
133 | export const gl_UNSIGNED_SHORT_5_6_5 = 33635;
134 | export const gl_FRAGMENT_SHADER = 35632;
135 | export const gl_VERTEX_SHADER = 35633;
136 | export const gl_MAX_VERTEX_ATTRIBS = 34921;
137 | export const gl_MAX_VERTEX_UNIFORM_VECTORS = 36347;
138 | export const gl_MAX_VARYING_VECTORS = 36348;
139 | export const gl_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661;
140 | export const gl_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660;
141 | export const gl_MAX_TEXTURE_IMAGE_UNITS = 34930;
142 | export const gl_MAX_FRAGMENT_UNIFORM_VECTORS = 36349;
143 | export const gl_SHADER_TYPE = 35663;
144 | export const gl_DELETE_STATUS = 35712;
145 | export const gl_LINK_STATUS = 35714;
146 | export const gl_VALIDATE_STATUS = 35715;
147 | export const gl_ATTACHED_SHADERS = 35717;
148 | export const gl_ACTIVE_UNIFORMS = 35718;
149 | export const gl_ACTIVE_ATTRIBUTES = 35721;
150 | export const gl_SHADING_LANGUAGE_VERSION = 35724;
151 | export const gl_CURRENT_PROGRAM = 35725;
152 | export const gl_NEVER = 512;
153 | export const gl_LESS = 513;
154 | export const gl_EQUAL = 514;
155 | export const gl_LEQUAL = 515;
156 | export const gl_GREATER = 516;
157 | export const gl_NOTEQUAL = 517;
158 | export const gl_GEQUAL = 518;
159 | export const gl_ALWAYS = 519;
160 | export const gl_KEEP = 7680;
161 | export const gl_REPLACE = 7681;
162 | export const gl_INCR = 7682;
163 | export const gl_DECR = 7683;
164 | export const gl_INVERT = 5386;
165 | export const gl_INCR_WRAP = 34055;
166 | export const gl_DECR_WRAP = 34056;
167 | export const gl_VENDOR = 7936;
168 | export const gl_RENDERER = 7937;
169 | export const gl_VERSION = 7938;
170 | export const gl_NEAREST = 9728;
171 | export const gl_LINEAR = 9729;
172 | export const gl_NEAREST_MIPMAP_NEAREST = 9984;
173 | export const gl_LINEAR_MIPMAP_NEAREST = 9985;
174 | export const gl_NEAREST_MIPMAP_LINEAR = 9986;
175 | export const gl_LINEAR_MIPMAP_LINEAR = 9987;
176 | export const gl_TEXTURE_MAG_FILTER = 10240;
177 | export const gl_TEXTURE_MIN_FILTER = 10241;
178 | export const gl_TEXTURE_WRAP_S = 10242;
179 | export const gl_TEXTURE_WRAP_T = 10243;
180 | export const gl_TEXTURE = 5890;
181 | export const gl_TEXTURE_CUBE_MAP = 34067;
182 | export const gl_TEXTURE_BINDING_CUBE_MAP = 34068;
183 | export const gl_TEXTURE_CUBE_MAP_POSITIVE_X = 34069;
184 | export const gl_TEXTURE_CUBE_MAP_NEGATIVE_X = 34070;
185 | export const gl_TEXTURE_CUBE_MAP_POSITIVE_Y = 34071;
186 | export const gl_TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072;
187 | export const gl_TEXTURE_CUBE_MAP_POSITIVE_Z = 34073;
188 | export const gl_TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074;
189 | export const gl_MAX_CUBE_MAP_TEXTURE_SIZE = 34076;
190 | export const gl_TEXTURE0 = 33984;
191 | export const gl_TEXTURE1 = 33985;
192 | export const gl_TEXTURE2 = 33986;
193 | export const gl_TEXTURE3 = 33987;
194 | export const gl_TEXTURE4 = 33988;
195 | export const gl_TEXTURE5 = 33989;
196 | export const gl_TEXTURE6 = 33990;
197 | export const gl_TEXTURE7 = 33991;
198 | export const gl_TEXTURE8 = 33992;
199 | export const gl_TEXTURE9 = 33993;
200 | export const gl_TEXTURE10 = 33994;
201 | export const gl_TEXTURE11 = 33995;
202 | export const gl_TEXTURE12 = 33996;
203 | export const gl_TEXTURE13 = 33997;
204 | export const gl_TEXTURE14 = 33998;
205 | export const gl_TEXTURE15 = 33999;
206 | export const gl_TEXTURE16 = 34000;
207 | export const gl_TEXTURE17 = 34001;
208 | export const gl_TEXTURE18 = 34002;
209 | export const gl_TEXTURE19 = 34003;
210 | export const gl_TEXTURE20 = 34004;
211 | export const gl_TEXTURE21 = 34005;
212 | export const gl_TEXTURE22 = 34006;
213 | export const gl_TEXTURE23 = 34007;
214 | export const gl_TEXTURE24 = 34008;
215 | export const gl_TEXTURE25 = 34009;
216 | export const gl_TEXTURE26 = 34010;
217 | export const gl_TEXTURE27 = 34011;
218 | export const gl_TEXTURE28 = 34012;
219 | export const gl_TEXTURE29 = 34013;
220 | export const gl_TEXTURE30 = 34014;
221 | export const gl_TEXTURE31 = 34015;
222 | export const gl_ACTIVE_TEXTURE = 34016;
223 | export const gl_REPEAT = 10497;
224 | export const gl_CLAMP_TO_EDGE = 33071;
225 | export const gl_MIRRORED_REPEAT = 33648;
226 | export const gl_FLOAT_VEC2 = 35664;
227 | export const gl_FLOAT_VEC3 = 35665;
228 | export const gl_FLOAT_VEC4 = 35666;
229 | export const gl_INT_VEC2 = 35667;
230 | export const gl_INT_VEC3 = 35668;
231 | export const gl_INT_VEC4 = 35669;
232 | export const gl_BOOL = 35670;
233 | export const gl_BOOL_VEC2 = 35671;
234 | export const gl_BOOL_VEC3 = 35672;
235 | export const gl_BOOL_VEC4 = 35673;
236 | export const gl_FLOAT_MAT2 = 35674;
237 | export const gl_FLOAT_MAT3 = 35675;
238 | export const gl_FLOAT_MAT4 = 35676;
239 | export const gl_SAMPLER_2D = 35678;
240 | export const gl_SAMPLER_CUBE = 35680;
241 | export const gl_VERTEX_ATTRIB_ARRAY_ENABLED = 34338;
242 | export const gl_VERTEX_ATTRIB_ARRAY_SIZE = 34339;
243 | export const gl_VERTEX_ATTRIB_ARRAY_STRIDE = 34340;
244 | export const gl_VERTEX_ATTRIB_ARRAY_TYPE = 34341;
245 | export const gl_VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922;
246 | export const gl_VERTEX_ATTRIB_ARRAY_POINTER = 34373;
247 | export const gl_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975;
248 | export const gl_IMPLEMENTATION_COLOR_READ_TYPE = 35738;
249 | export const gl_IMPLEMENTATION_COLOR_READ_FORMAT = 35739;
250 | export const gl_COMPILE_STATUS = 35713;
251 | export const gl_LOW_FLOAT = 36336;
252 | export const gl_MEDIUM_FLOAT = 36337;
253 | export const gl_HIGH_FLOAT = 36338;
254 | export const gl_LOW_INT = 36339;
255 | export const gl_MEDIUM_INT = 36340;
256 | export const gl_HIGH_INT = 36341;
257 | export const gl_FRAMEBUFFER = 36160;
258 | export const gl_RENDERBUFFER = 36161;
259 | export const gl_RGBA4 = 32854;
260 | export const gl_RGB5_A1 = 32855;
261 | export const gl_RGB565 = 36194;
262 | export const gl_DEPTH_COMPONENT16 = 33189;
263 | export const gl_STENCIL_INDEX8 = 36168;
264 | export const gl_DEPTH_STENCIL = 34041;
265 | export const gl_RENDERBUFFER_WIDTH = 36162;
266 | export const gl_RENDERBUFFER_HEIGHT = 36163;
267 | export const gl_RENDERBUFFER_INTERNAL_FORMAT = 36164;
268 | export const gl_RENDERBUFFER_RED_SIZE = 36176;
269 | export const gl_RENDERBUFFER_GREEN_SIZE = 36177;
270 | export const gl_RENDERBUFFER_BLUE_SIZE = 36178;
271 | export const gl_RENDERBUFFER_ALPHA_SIZE = 36179;
272 | export const gl_RENDERBUFFER_DEPTH_SIZE = 36180;
273 | export const gl_RENDERBUFFER_STENCIL_SIZE = 36181;
274 | export const gl_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048;
275 | export const gl_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049;
276 | export const gl_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050;
277 | export const gl_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051;
278 | export const gl_COLOR_ATTACHMENT0 = 36064;
279 | export const gl_DEPTH_ATTACHMENT = 36096;
280 | export const gl_STENCIL_ATTACHMENT = 36128;
281 | export const gl_DEPTH_STENCIL_ATTACHMENT = 33306;
282 | export const gl_NONE = 0;
283 | export const gl_FRAMEBUFFER_COMPLETE = 36053;
284 | export const gl_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054;
285 | export const gl_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055;
286 | export const gl_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057;
287 | export const gl_FRAMEBUFFER_UNSUPPORTED = 36061;
288 | export const gl_FRAMEBUFFER_BINDING = 36006;
289 | export const gl_RENDERBUFFER_BINDING = 36007;
290 | export const gl_MAX_RENDERBUFFER_SIZE = 34024;
291 | export const gl_INVALID_FRAMEBUFFER_OPERATION = 1286;
292 | export const gl_UNPACK_FLIP_Y_WEBGL = 37440;
293 | export const gl_UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441;
294 | export const gl_CONTEXT_LOST_WEBGL = 37442;
295 | export const gl_UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443;
296 | export const gl_BROWSER_DEFAULT_WEBGL = 37444;
--------------------------------------------------------------------------------
/src/index.debug.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/src/index.release.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |