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