Sfoglia il codice sorgente

"align" iMouse with the webgl coords

i.e. origin is in the left, lower corner.  (this is how shadertoy does
it, and we better be a bit compatible if we're using the same variable
names and stuff.  and it's also better.)
Lucas Stadler 10 anni fa
parent
commit
d71c9a2763
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      glsl/raymarching.js

+ 1 - 1
glsl/raymarching.js

@ -207,7 +207,7 @@ void main() {
207 207
    });
208 208
    
209 209
    tt.canvas.addEventListener("mousemove", function(ev) {
210
      gl.uniform3f(iMouse, ev.clientX, ev.clientY, 0.0);
210
      gl.uniform3f(iMouse, ev.clientX, canvas.clientHeight - ev.clientY, 0.0);
211 211
      requestAnimationFrame(tt.render);
212 212
    });
213 213