ソースを参照

"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 年 前
コミット
d71c9a2763
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  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