Added HTMLTexture#31233
Merged
Merged
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Contributor
|
so weird, but also so usefull! |
Contributor
|
When I try out I don't see the inline image drawn. When I switch to a same origin image it works. This may be expected behavior. Although I see the 2D canvas example working currently with a different origin image. |
Contributor
|
Also, you can now try this a bit easier. In the latest Chrome Beta (or Dev, Canary; just not Stable), there is now a 'HTML-in-Canvas' flag (chrome://flags) you can enable. |
… example. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
|
Added interaction support. Screen.Recording.2026-04-10.at.09.38.51.mov |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Texture. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Adds support for rendering HTML elements as textures on 3D surfaces using the HTML-in-Canvas API. Works with both WebGL and WebGPU renderers.
HTMLTexture— A new texture class that renders a live HTML element onto a mesh via the browser's HTML-in-Canvas API. The renderer automatically sets uplayoutsubtreeon the canvas and appends the element as a child.InteractionManager— A new addon that enables native browser pointer interaction with meshes. For HTMLTexture meshes, it computes a CSSmatrix3dtransform each frame so the browser handles hit-testing, hover, focus, and input natively — no raycasting or synthetic events needed.webgl_materials_texture_htmlandwebgpu_materials_texture_htmldemonstrate both features with formatted text, images, SVG, an input field, and a button.https://raw.githack.com/mrdoob/three.js/dev/examples/webgl_materials_texture_html.html
Usage
(Requires passing --enable-blink-features=CanvasDrawElement to Chrome Canary versions later than 138.0.7175.0)
Here's a jsfiddle for anyone that wants to experiment with this: https://jsfiddle.net/dgw4y3ck/