maxkrieger / aframe-draw-component

HTML5 canvas component for AFrame VR.
http://a9.io/aframe-draw-component/
57 stars 8 forks source link

Performance issue using canvas.toDataURL? #3

Closed bnolan closed 8 years ago

bnolan commented 8 years ago

Would it be faster to set the texture directly from the canvas by manipulating the Object3D.material?

maxkrieger commented 8 years ago

Is this possible? I'm not familiar with threejs.

bnolan commented 8 years ago

Yup, definitely possible, something like:

    var texture1 = new THREE.Texture(canvas1) 
    texture1.needsUpdate = true;

This is an example of setting a texture from a canvas.

https://stemkoski.github.io/Three.js/Texture-From-Canvas.html

Great component by the way, I've been using it for my htmltexture component.

maxkrieger commented 8 years ago

ah, I'll implement that tomorrow. Would probably solve https://github.com/maxkrieger/aframe-draw-component/issues/2 too.

I saw htmltexture, and featured it in the readme! Exciting to see us nearing "endgame" already.

maxkrieger commented 8 years ago

Just released 1.3.0 which implements this! Thx!