Skip to content

Commit f908224

Browse files
tomhsiao1260PWhiddy
authored andcommitted
fullscreen triangle optimization
1 parent ce0a01a commit f908224

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

targets/minimalRenderer.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,15 @@ function fragToMinimalRenderer(canvas, fullFrag, updateUniforms) {
8181
resizeCanvas();
8282
window.addEventListener("resize", resizeCanvas);
8383
const gl = canvas.getContext("webgl2");
84+
// Learn more: https://github.com/mrdoob/three.js/pull/21358
8485
const vertices = [
85-
-1.0, 1.0, 0.0, -1.0, -1.0, 0.0, 1.0, -1.0, 0.0, 1.0, 1.0, 0.0,
86+
-1.0, -1.0, 0.0, 3.0, -1.0, 0.0, -1.0, 3.0, 0.0,
8687
];
87-
const indices = [3, 2, 1, 3, 1, 0];
88+
const indices = [0, 1, 2];
89+
// const vertices = [
90+
// -1.0, 1.0, 0.0, -1.0, -1.0, 0.0, 1.0, -1.0, 0.0, 1.0, 1.0, 0.0,
91+
// ];
92+
// const indices = [3, 2, 1, 3, 1, 0];
8893
const vertex_buffer = gl.createBuffer();
8994
gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer);
9095
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);

0 commit comments

Comments
 (0)