From 588f5c09d858fb6dd7d8e17d39b62fbab6b59ff4 Mon Sep 17 00:00:00 2001 From: biglyderv Date: Tue, 4 Mar 2025 05:14:52 -0500 Subject: [PATCH] gl and clicking fiexs --- docs/index.html | 2 +- docs/js/index.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/index.html b/docs/index.html index 638ffe0..1cb4dbf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,7 +33,7 @@ void main() { // gl_FragColor is a special variable a fragment shader // is responsible for setting - float dist = (log(distance(b_position.xy,vec2(0.0))) - size_thing) / log(2.0) * 0.1; + float dist = (log(distance(b_position.xy,vec2(0.0))) - size_thing + dist_thing) / log(2.0) * 0.1; gl_FragColor = vec4((mod(dist,0.1) - 0.1 + 0.1 * dist_thing) * 50.0 * vec3(1,1,1),1); // return redish-purple } diff --git a/docs/js/index.js b/docs/js/index.js index ccd31bc..d60f65d 100644 --- a/docs/js/index.js +++ b/docs/js/index.js @@ -106,7 +106,7 @@ function renderThing() { hud.textContent = `${Math.floor(nothingness * 100) / 100} nothings; ${Math.floor(nGain * 60 * 100) / 100} nil/sec` gl.uniform1f(sizeBuffer, -Math.log(nothingness)); - gl.uniform1f(distBuffer, 0.1 + nGain / (nothingness+10)); + gl.uniform1f(distBuffer, 0.1 + 3 * nGain/(nGain+1)); var primitiveType = gl.TRIANGLES; var offset = 0; @@ -121,6 +121,11 @@ requestAnimationFrame(renderThing) let clicking = false; +setInterval(function() { + + nothingness += nGain; +},1000 / 60) + document.body.onclick = async function() { if (clicking) return; clicking = true; @@ -128,7 +133,6 @@ document.body.onclick = async function() { nGain += 0.05; while (nGain > oldNGain) { nGain -= 0.005; - nothingness += nGain; await new Promise((res) => setTimeout(res,1000 / 60)) } nGain = oldNGain;