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

[3.x] Make WebXR touch events proportional to render target size, not viewport #57449

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jan 30, 2022

This is a fix to #56819 which is only in 3.x.

The position of touch events was previously proportional to the viewport. This is problematic when the render target from WebXR is a different size than the viewport - the touches will be in the wrong place.

(Note: This isn't the ideal fix - it would be better if the viewport resized to match the render target, but for some reason that isn't "sticking". I suspect this may require some deeper changes in the HTML5 platform. But that's for a future PR!)

@dsnopek dsnopek requested a review from a team as a code owner January 30, 2022 15:01
@dsnopek dsnopek added this to the 3.5 milestone Jan 30, 2022
@BastiaanOlij
Copy link
Contributor

Interesting that this should be a problem because there shouldn't be a reason for handheld AR devices to change the render target size away from the viewport. That said, seeing when a viewport is marked as the XR viewport the render target size overrides the viewport size and the viewport size becomes defunct, this solution seems sound.

@akien-mga akien-mga merged commit a0438ff into godotengine:3.x Jan 31, 2022
@akien-mga
Copy link
Member

Thanks!

@dsnopek
Copy link
Contributor Author

dsnopek commented Jan 31, 2022

That said, seeing when a viewport is marked as the XR viewport the render target size overrides the viewport size and the viewport size becomes defunct

Yeah, the thing is the viewport size isn't "sticking" for some reason, it keeps resetting to the size of the browser window. I think this an HTML5 platform thing, I just haven't had a chance to dig that deep yet. Something for my next PR! :-)

@dsnopek dsnopek deleted the webxr-ar-touch-render-target branch July 22, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants