Skip to content

HTMLMesh is creating a lot of canvas objects. #22093

@sigmaxipi

Description

@sigmaxipi
  1. Open https://threejs.org/examples/?q=vr#webxr_vr_sandbox or another example using HTMLMesh.
  2. Set a breakpoint on var canvas = document.createElement( 'canvas' ); or log at document.createElement via ce = document.createElement; document.createElement = function() { console.log('ce' + arguments[0]); return ce.apply(document, arguments)} in the console.
  3. Interact with the GUI and hit the breakpoint.

Are all these canvases required?

I cached the canvas and both the webxr_vr_sandbox demo and threejs/editor appeared to work without any issues.

I can submit a PR if you're OK with the changes.

Live example
https://threejs.org/examples/webxr_vr_sandbox.html vs https://raw.githack.com/sigmaxipi/three.js/dev/examples/webxr_vr_sandbox.html

https://threejs.org/editor/ vs https://raw.githack.com/sigmaxipi/three.js/dev/editor/

Platform:

  • Device: Quest
  • Three.js version: dev

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions