Compare commits
No commits in common. "efdedb23b8becfdaf7b43b431007fc369bae318d" and "3e3211b7e17abfb39cb0c1170df95d8b3c0db8bf" have entirely different histories.
efdedb23b8
...
3e3211b7e1
2 changed files with 4 additions and 12 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>have you tried crying more?</title>
|
<title>WebGL Demo</title>
|
||||||
<!-- <script -->
|
<!-- <script -->
|
||||||
<!-- src="https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.8.1/gl-matrix-min.js" -->
|
<!-- src="https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.8.1/gl-matrix-min.js" -->
|
||||||
<!-- integrity="sha512-zhHQR0/H5SEBL3Wn6yYSaTTZej12z0hVZKOv3TwCUXT1z5qeqGcXJLLrbERYRScEDDpYIJhPC1fk31gqR783iQ==" -->
|
<!-- integrity="sha512-zhHQR0/H5SEBL3Wn6yYSaTTZej12z0hVZKOv3TwCUXT1z5qeqGcXJLLrbERYRScEDDpYIJhPC1fk31gqR783iQ==" -->
|
||||||
|
|
|
||||||
|
|
@ -70,29 +70,21 @@ function renderShader(gl, vsSource, fsSource) {
|
||||||
// Draw the scene
|
// Draw the scene
|
||||||
// drawScene(gl, programInfo, buffers, 0);
|
// drawScene(gl, programInfo, buffers, 0);
|
||||||
|
|
||||||
const fpsLimit = 30;
|
|
||||||
const fpsDelta = 1000 / 30;
|
|
||||||
// let timePrev = 0;
|
// let timePrev = 0;
|
||||||
// requestAnimationFrame asks the browser to call render,
|
// requestAnimationFrame asks the browser to call render,
|
||||||
// providing the time in milliseconds since the page loaded
|
// providing the time in milliseconds since the page loaded
|
||||||
function render(time) {
|
function render(time) {
|
||||||
time *= 0.001; // convert to seconds
|
time *= 0.001; // convert to seconds
|
||||||
// delta = time - timePrev;
|
// deltaTime = time - prevTime;
|
||||||
|
// prevTime = time;
|
||||||
|
|
||||||
drawScene(gl, programInfo, buffers, time);
|
drawScene(gl, programInfo, buffers, time);
|
||||||
|
|
||||||
setTimeout(() => requestAnimationFrame(render), fpsDelta);
|
|
||||||
}
|
|
||||||
function update() {
|
|
||||||
requestAnimationFrame(render);
|
requestAnimationFrame(render);
|
||||||
}
|
}
|
||||||
|
requestAnimationFrame(render);
|
||||||
|
|
||||||
// XXX: TODO: read this guide it's great! https://stackoverflow.com/questions/56998225/why-is-rendering-blurred-in-webgl
|
// XXX: TODO: read this guide it's great! https://stackoverflow.com/questions/56998225/why-is-rendering-blurred-in-webgl
|
||||||
// window.addEventListener('resize', render);
|
// window.addEventListener('resize', render);
|
||||||
|
|
||||||
requestAnimationFrame(render);
|
|
||||||
// update();
|
|
||||||
// setInterval(update, 1000 / fpsLimit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchShader(name) {
|
function fetchShader(name) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue