relative rendering, but maybe still a bug with proportions?
This commit is contained in:
+5
-13
@@ -5,7 +5,7 @@ const socket = io("http://localhost:3000");
|
|||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
fps: 60,
|
fps: 60,
|
||||||
zoom: 0.01,
|
zoom: 0.1,
|
||||||
backgroundTicks: 60,
|
backgroundTicks: 60,
|
||||||
textSpread: 0,
|
textSpread: 0,
|
||||||
maxSpawns: 1,
|
maxSpawns: 1,
|
||||||
@@ -188,12 +188,8 @@ const sketch = (p) => {
|
|||||||
p.background(0);
|
p.background(0);
|
||||||
|
|
||||||
p.shader(shaderProgram);
|
p.shader(shaderProgram);
|
||||||
// p.ortho(x, x + width, y + height, y);
|
// p.ortho(0, p.width, -p.height, 0);
|
||||||
// p.ortho(0, -p.windowWidth, -p.windowHeight, 0);
|
p.ortho(x, x + width, -y - height, -y);
|
||||||
console.log(
|
|
||||||
`ortho: ${-p.width / 2}, ${p.width / 2}, ${-p.height / 2}, ${p.height / 2}`,
|
|
||||||
);
|
|
||||||
p.ortho(0, p.width, -p.height, 0);
|
|
||||||
|
|
||||||
// Bind texture array
|
// Bind texture array
|
||||||
gl.activeTexture(gl.TEXTURE0);
|
gl.activeTexture(gl.TEXTURE0);
|
||||||
@@ -213,12 +209,8 @@ const sketch = (p) => {
|
|||||||
// Tell shader which layer to sample
|
// Tell shader which layer to sample
|
||||||
shaderProgram.setUniform("uLayer", currentLayer);
|
shaderProgram.setUniform("uLayer", currentLayer);
|
||||||
|
|
||||||
// Draw a quad covering the screen
|
p.rect(col * tileW, row * tileH, tileW, tileH);
|
||||||
console.log(
|
// p.rect(0, 0, tileW, tileH);
|
||||||
`Drawing tile ${currentLayer} at ${col * tileW}, ${row * tileH}`,
|
|
||||||
);
|
|
||||||
// p.rect(col * tileW, row * tileH, tileW, tileH);
|
|
||||||
p.rect(0, 0, tileW, tileH);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user