supereggbert / aframe-htmlembed-component

HTML Component for A-Frame VR that allows for interaction with HTML in VR. Demo https://supereggbert.github.io/aframe-htmlembed-component/dist/examples/index.html
MIT License
196 stars 41 forks source link

Freezing browser during render #19

Open bknill opened 4 years ago

bknill commented 4 years ago

I'm having problems where the browser is freezing during new renders.

Is there a way to pre-render and cache the image?

Ideally we could use web workers to render in a new thread, but they don't support canvas.

EDIT - Seems you can render offscreen. https://developers.google.com/web/updates/2018/08/offscreen-canvas

I'll see if I can get this working.

bknill commented 4 years ago

Ran into a bug in Chrome which means this isn't currently possible because of a tainted canvas.

I'm running this in Aframe 1.0.2.

I notice your examples don't freeze the browser during render, not sure what I'm doing differently.

Do you get a freeze in newer versions of Aframe?

aChanEP commented 4 years ago

I am running into this issue as well. I can ultimately get the html rendering within the scene but it takes an awfully long time and freezes browser during a re-render as mentioned above. I am using aframe-react: 4.4.0 to render the aframe markup with aframe: 1.0.4 as well as chrome: 80.0.3987.132.

bknill commented 4 years ago

@aChanEP yep I had to ditch this because of the freezing. Doesn't seem to be any way around it, especially with dynamically rendered content.

aChanEP commented 4 years ago

@bknill good to know. I did the exact same thing. Thanks!

michaelthatsit commented 4 years ago

Hey I ran into this problem in react as well. It's because the component reloads every stylesheet on the page when it's initialized. I forked the project, and added StyleSheetId to the schema to, which lets you specify the specific style sheet that should be reloaded. I made a pull request to integrate the changes.

lmcarreiro commented 3 years ago

Same as #22

lmcarreiro commented 3 years ago

Is there any workaround?