Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.41k forks source link

Empty transform matrix causing reference errors #6495

Closed rawnsley closed 2 months ago

rawnsley commented 3 months ago

A recent update to Chrome (128) appears to have exposed a bug, as described in this Discord post.

I traced at least one cause (there may be more) to the use of a temporary array in the hoverable-visuals component. A threejs matrix is copied into the array and then the position elements are read and ultimately submitted as uniforms to the WebGL shader. However, if interactorOne or interactorTwo are not active, the matrix is not written and the required elements are never initialized. Seeding the array with a unit matrix fixes the problem.

It's not clear why this has only just started causing a runtime issue. Perhaps Chrome used to interpret undefined as zero instead of throwing a TypeError?

Exairnous commented 2 months ago

LGTM. Merging.