immersive-web / model-element

Repository for the <model> tag. Feature leads: Marcos Cáceres and Laszlo Gombos
https://immersive-web.github.io/model-element/
Other
62 stars 11 forks source link

Interactions with HTMLCanvasElement #58

Open marcoscaceres opened 1 year ago

marcoscaceres commented 1 year ago

What would be useful is allowing canvas.drawImage() to take a <model>. .drawImage() accepts <video>, <img> already (plus a bunch of other related things). One could then create neat little renders to composite onto a canvas.

cabanier commented 1 year ago

Is that really needed? Authors can already use frameworks to do the same. With a framework they'll also have more control.

In addition, if we allow rendering to a canvas, we need to have consistent rendering across UAs

marcoscaceres commented 1 year ago

Authors can already use frameworks to do the same. With a framework they'll also have more control.

Sure, but the point is not to require a framework.

In addition, if we allow rendering to a canvas, we need to have consistent rendering across UAs

Depends on the definition of "consistent": it's not hard requirement, as it isn't a requirement with CSS, WebGL, or with <model>, as otherwise <model> wouldn't be viable either.

cabanier commented 1 year ago

Authors can already use frameworks to do the same. With a framework they'll also have more control.

Sure, but the point is not to require a framework.

At least for us, the point is that a model will render in actual 3D. :-)

In addition, if we allow rendering to a canvas, we need to have consistent rendering across UAs

Depends on the definition of "consistent": it's not hard requirement, as it isn't a requirement with CSS, WebGL, or with <model>, as otherwise <model> wouldn't be viable either.

Don't 2D Canvas and WebGL have conformance tests on rendered pixels? I suspect we will have to develop a similar test suite if we allow a model as a canvas image source.