Skip to content

Commit

Permalink
Update shader.frag
Browse files Browse the repository at this point in the history
  • Loading branch information
jcponce committed Mar 22, 2024
1 parent 2836a71 commit 8afb45c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sketches/shaders/box-space/shader.frag
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ void main() {

vec2 uv = ( coord * 2.0 - 1.0 ) * iResolution.xy / iResolution.y;

vec2 mousePrevious = vec2(0.0, 0.0);
vec2 m = (iMouse.xy * 2. - iResolution.xy) / iResolution.y;

mousePrevious = m;
// Default circular motion if mouse not clicked
if(!iView) m = vec2(-1.0, 0.0);
if(!iView) {
m = mousePrevious;
}

vec3 ro = vec3(0.0, 0.0, -3.0); // ray origin
vec3 rd = normalize(vec3(uv, 1.0)); // ray direction
Expand Down

0 comments on commit 8afb45c

Please sign in to comment.