Browse Source

Added HTMLTexture example to files.json and API warning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mr.doob 1 week ago
parent
commit
938c8e2f9f

+ 1 - 0
examples/files.json

@@ -153,6 +153,7 @@
 		"webgl_materials_texture_anisotropy",
 		"webgl_materials_texture_canvas",
 		"webgl_materials_texture_filters",
+		"webgl_materials_texture_html",
 		"webgl_materials_texture_manualmipmap",
 		"webgl_materials_texture_partialupdate",
 		"webgl_materials_texture_rotation",

BIN
examples/screenshots/webgl_materials_texture_html.jpg


+ 7 - 0
examples/webgl_materials_texture_html.html

@@ -104,6 +104,13 @@
 			function init() {
 
 				renderer = new THREE.WebGLRenderer( { antialias: true, canvas: canvas } );
+
+				if ( renderer.getContext().texElementImage2D === undefined ) {
+
+					info.innerHTML += '<br>This browser does not support the <a href="https://github.com/WICG/html-in-canvas" target="_blank">HTML-in-Canvas API</a>.';
+
+				}
+
 				renderer.toneMapping = THREE.NeutralToneMapping;
 				renderer.setPixelRatio( window.devicePixelRatio );
 				renderer.setSize( window.innerWidth, window.innerHeight );

粤ICP备19079148号