iMouse.w behavior is different from Shadertoy
Closed this issue · 0 comments
theetcher commented
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