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

fix u_mouse and u_resolution #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edap
Copy link

@edap edap commented Dec 4, 2019

I was having a weird issue with the u_mouse uniform while mapping the mouse to the center of the screen using:

vec2 mouse = (2.0 * u_mouse.xy - u_resolution.xy)/ u_resolution.y;

Then I have noticed that the u_mouse and the u_resolution are passed in different scale. The mouse values where multiplied by this.realToCSSPixels, while the mouse no. I have mutliplied also the the resolution by this.realToCSSPixels, and now u_mouse and u_resolution are under the same scale factor.

After changing the glslCanvas file I have also run the build, that's why some changes are also into the dist folder.

@edap edap changed the title Merge pull request #51 from signal-noise/cancel-animation fix mouse and resolution Dec 4, 2019
@edap edap changed the title fix mouse and resolution fix u_mouse and u_resolution Dec 4, 2019
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 this pull request may close these issues.

2 participants