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

q5-webgpu fallback: origin is double-translated #95

Open
keturn opened this issue Dec 19, 2024 · 1 comment
Open

q5-webgpu fallback: origin is double-translated #95

keturn opened this issue Dec 19, 2024 · 1 comment

Comments

@keturn
Copy link

keturn commented Dec 19, 2024

I think the origin is supposed to be in the center of the canvas in webgpu and webgpu-fallback, but it currently gets shifted both in _beginRender:

q5.js/src/q5-core.js

Lines 182 to 185 in 75b8271

if ($._webgpuFallback) {
$.colorMode('rgb', 1);
$._beginRender = () => $.translate($.canvas.hw, $.canvas.hh);
}

and resetMatrix:
if ($._webgpuFallback) $.translate($.canvas.hw, $.canvas.hh);

so it ends up at the bottom-right of the screen when draw is called.

@quinton-ashley
Copy link
Collaborator

ah true! q5 no longer needs the translation in beginRender since resetMatrix runs at the start of each frame.

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

No branches or pull requests

2 participants