Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iMouse.w behavior is different from Shadertoy #135

Closed
theetcher opened this issue Oct 23, 2021 · 0 comments · Fixed by #168
Closed

iMouse.w behavior is different from Shadertoy #135

theetcher opened this issue Oct 23, 2021 · 0 comments · Fixed by #168

Comments

@theetcher
Copy link

I assume this "desync" happened in Nov, 2020

from https://shadertoyunofficial.wordpress.com/2016/07/20/special-shadertoy-features/

mouse button events ( added in Nov, 2020 ):

  • down even (i.e. just clicked) if iMouse.z > 0. && iMouse.w > 0.
  • currently down: if iMouse.z > 0. ( && iMouse.w < 0.)
  • released: if Mouse.z < 0 && iMouse.w < 0.

It is more clearer if you observe this shader for iMouse channels data in the left-bottom corner: https://www.shadertoy.com/view/llySRh

in short - sign management is different:

  • iMouse.w:
    • positive only for the first frame if mouse button pressed
    • otherwise it is negative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant