add layer counter, graphics stuff
This commit is contained in:
parent
f718e8d41f
commit
aa9674718f
4 changed files with 15 additions and 7 deletions
|
@ -37,11 +37,13 @@
|
||||||
// gl_FragColor is a special variable a fragment shader
|
// gl_FragColor is a special variable a fragment shader
|
||||||
// is responsible for setting
|
// is responsible for setting
|
||||||
if (is_fg) {
|
if (is_fg) {
|
||||||
gl_FragColor = vec4(b_position.xyz,1) * 0.2 + vec4(0.3,0.3,0.3,1) * 0.8;
|
gl_FragColor = vec4(b_position.xyz,1.0) * 0.5 + vec4(1.0,1.0,1.0,1.0) * 0.5;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
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) / 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
|
dist = mod(dist,0.1);
|
||||||
|
dist = abs(dist - 0.05) + 0.05;
|
||||||
|
gl_FragColor = vec4((mod(dist,0.1) - 0.1 + 0.1 * dist_thing) * 50.0 * vec3(1,1,1),1);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
let hud = document.querySelector('.main-hud');
|
let hud = document.querySelector('.main-hud');
|
||||||
var nothingness = (window.localStorage.getItem('nothings') || 1) * 1, nGain = 0.003;
|
var nothingness = (window.localStorage.getItem('nothings') || 1) * 1, nGain = 0.003;
|
||||||
|
var layers = 1;
|
||||||
var getBonus = 0;
|
var getBonus = 0;
|
||||||
|
|
||||||
var mx = 0, my = 0;
|
var mx = 0, my = 0;
|
||||||
|
@ -40,14 +41,16 @@ document.querySelector('canvas').addEventListener('click', (e) => {
|
||||||
|
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
nothingness += nGain + getBonus;
|
nothingness += nGain + getBonus;
|
||||||
|
layers = Math.log(nothingness + 1) / Math.log(2);
|
||||||
nGain = 0.003 + 0.003 * cubePos.length;
|
nGain = 0.003 + 0.003 * cubePos.length;
|
||||||
getBonus *= 0.93;
|
getBonus *= 0.93;
|
||||||
|
|
||||||
hud.textContent = `${numify(nothingness)} nil; ${numify((nGain + getBonus) * 60)} nil/sec`
|
hud.textContent = `${numify(nothingness)} nil; ${numify((nGain + getBonus) * 60)} nil/sec\n`
|
||||||
|
+ `${numify(layers)} layers; ${numify((Math.log(nothingness + nGain + getBonus + 1) / Math.log(2) - layers) * 60)} layers/sec`;
|
||||||
|
|
||||||
for (let ab in cubePos) {
|
for (let ab in cubePos) {
|
||||||
let a = cubePos[ab];
|
let a = cubePos[ab];
|
||||||
let bonus = 1 + counts.doNothing / (ab* .02 + 2);
|
let bonus = 1 + counts.doNothing / (ab * .02 + 2);
|
||||||
bonus = (bonus) ** 0.05;
|
bonus = (bonus) ** 0.05;
|
||||||
|
|
||||||
let f = (nGain + getBonus * bonus * 10000 + 10) / (nothingness + 10);
|
let f = (nGain + getBonus * bonus * 10000 + 10) / (nothingness + 10);
|
||||||
|
@ -66,6 +69,8 @@ setInterval(function () {
|
||||||
|
|
||||||
a[4] += -Math.sin(f * 0.1) * a[0];
|
a[4] += -Math.sin(f * 0.1) * a[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frames++;
|
||||||
}, 1000 / 60)
|
}, 1000 / 60)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ratio = 1, width = 1, height = 1;
|
var ratio = 1, width = 1, height = 1, frames = 0;
|
||||||
var canvas, gl, positionAttributeLocation, positionBuffer, matBuffer, vpBuffer, sizeBuffer, distBuffer, fgBuffer;
|
var canvas, gl, positionAttributeLocation, positionBuffer, matBuffer, vpBuffer, sizeBuffer, distBuffer, fgBuffer;
|
||||||
|
|
||||||
function createShader(gl, type, source) {
|
function createShader(gl, type, source) {
|
||||||
|
@ -138,8 +138,9 @@ function renderThing() {
|
||||||
let vp = MDN.rotateYMatrix(Math.log(nothingness + 1) * cubie[2] / 10);
|
let vp = MDN.rotateYMatrix(Math.log(nothingness + 1) * cubie[2] / 10);
|
||||||
|
|
||||||
let bonus = 1 + counts.doNothing / (ii * .02 + 2);
|
let bonus = 1 + counts.doNothing / (ii * .02 + 2);
|
||||||
bonus = bonus ** (1 / 3);
|
bonus = bonus ** (1 / 3)
|
||||||
|
|
||||||
|
vp = MDN.multiplyMatrices(MDN.rotateXMatrix(frames * 0.01),vp);
|
||||||
vp = MDN.multiplyMatrices(MDN.scaleMatrix(sizes * bonus, sizes * bonus, sizes * bonus), vp)
|
vp = MDN.multiplyMatrices(MDN.scaleMatrix(sizes * bonus, sizes * bonus, sizes * bonus), vp)
|
||||||
vp = MDN.multiplyMatrices(MDN.translateMatrix(cubie[0], cubie[1], cubie[2]), vp)
|
vp = MDN.multiplyMatrices(MDN.translateMatrix(cubie[0], cubie[1], cubie[2]), vp)
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ html {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item, .desc {
|
.item, .desc, .main-hud {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue