-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Description
Description
Dear maintainers,
I am using three.js via A-Frame, on a scene closely related to the one in https://github.com/AdaRoseCannon/aframe-xr-boilerplate.
In this particular scene, the material for the big glass window in the venue is replaced on the fly by a different one (see https://github.com/AdaRoseCannon/aframe-xr-boilerplate/blob/bb5a6b97aa4bf4058dd1512b2ef3155df8a5ccc6/main.js#L276-L322).
In my scene, I have not performed this dynamical material replacement and just used the original model material. So far this has been working good enough with A-Frame versions <= 1.5.0.
When experimenting with newer A-Frame versions, I have noticed a severe sluggishness when accessing my scene in VR. At first I have blamed my custom code, but after some research and optimization attempts I could pinpoint the change in behavior to the switch to r160 in aframevr/aframe@f06bcb6, in conjunction with the model used in the scene https://cdn.glitch.global/d29f98b4-ddd1-4589-8b66-e2446690e697/venue.glb?v=1644331843500
Reproduction steps
I have prepared 2 Glitch examples where I show the behavior before and after the switch to r160.
on three.js < r160
- Visit https://sudden-equal-ghoul.glitch.me/ using Meta Quest 2 and Wolvic browser
- Enter VR and look around in the direction of the big window
Expected result: decent framerate
on three.js >= r160
- Visit https://alkaline-curse-eye.glitch.me/ using Meta Quest 2 and Wolvic browser
- Enter VR and look around in the direction of the big window
Expected result: sluggish framerate
Notes
- replacing the material on the fly like in the original boilerplate example will mitigate the issue. This tells me the issue may be related with the type of material
- issue can be reproduced also on the native quest browser, but being more performant, this could be less noticeable
- issue can be reproduced also on Quest 3
- All versions of A-Frame using three.js >= r160 display this behavior
I attach a picture of the showing which material I am referring to in the venue model.
Code
See glitch...
Live example
Screenshots
Version
r159
Device
Headset
Browser
Chrome, Firefox
OS
Android
