Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 102 additions & 12 deletions build/three.cjs

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright 2010-2026 Three.js Authors
* SPDX-License-Identifier: MIT
*/
const REVISION = '184dev';
const REVISION = '184';

/**
* Represents mouse buttons and interaction types in context of controls.
Expand Down Expand Up @@ -25023,9 +25023,10 @@ class Plane {
*
* @param {Line3} line - The line to compute the intersection for.
* @param {Vector3} target - The target vector that is used to store the method's result.
* @return {?Vector3} The intersection point.
* @param {boolean} [clampToLine=true] - Whether to clamp the intersection to the line segment.
* @return {?Vector3} The intersection point. Returns `null` if no intersection is detected.
*/
intersectLine( line, target ) {
intersectLine( line, target, clampToLine = true ) {

const direction = line.delta( _vector1 );

Expand All @@ -25047,7 +25048,7 @@ class Plane {

const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;

if ( t < 0 || t > 1 ) {
if ( ( clampToLine === true ) && ( t < 0 || t > 1 ) ) {

return null;

Expand Down
2 changes: 1 addition & 1 deletion build/three.core.min.js

Large diffs are not rendered by default.

107 changes: 98 additions & 9 deletions build/three.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.module.min.js

Large diffs are not rendered by default.

99 changes: 47 additions & 52 deletions build/three.webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33593,6 +33593,13 @@ class Textures extends DataMap {
*/
this.info = info;

/**
* A set of HTMLTextures that need paint updates.
*
* @type {Set<HTMLTexture>}
*/
this._htmlTextures = new Set();

}

/**
Expand Down Expand Up @@ -33785,6 +33792,32 @@ class Textures extends DataMap {

}

// Set up shared paint callback for all HTMLTextures.

if ( this._htmlTextures.size === 0 ) {

const htmlTextures = this._htmlTextures;

canvas.onpaint = ( event ) => {

const changed = event && event.changedElements;

for ( const t of htmlTextures ) {

if ( ! changed || changed.includes( t.image ) ) {

t.needsUpdate = true;

}

}

};

}

this._htmlTextures.add( texture );

}

}
Expand Down Expand Up @@ -34126,6 +34159,8 @@ class Textures extends DataMap {

}

this._htmlTextures.delete( texture );

this.delete( texture );

this.info.destroyTexture( texture );
Expand Down Expand Up @@ -63132,23 +63167,23 @@ ${ flowData.code }

if ( offsetSnippet ) {

snippet = `texelFetchOffset( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), ${ levelSnippet }, ${ offsetSnippet } )`;
snippet = `texelFetchOffset( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), int( ${ levelSnippet } ), ${ offsetSnippet } )`;

} else {

snippet = `texelFetch( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), ${ levelSnippet } )`;
snippet = `texelFetch( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), int( ${ levelSnippet } ) )`;

}

} else {

if ( offsetSnippet ) {

snippet = `texelFetchOffset( ${ textureProperty }, ${ uvIndexSnippet }, ${ levelSnippet }, ${ offsetSnippet } )`;
snippet = `texelFetchOffset( ${ textureProperty }, ${ uvIndexSnippet }, int( ${ levelSnippet } ), ${ offsetSnippet } )`;

} else {

snippet = `texelFetch( ${ textureProperty }, ${ uvIndexSnippet }, ${ levelSnippet } )`;
snippet = `texelFetch( ${ textureProperty }, ${ uvIndexSnippet }, int( ${ levelSnippet } ) )`;

}

Expand Down Expand Up @@ -67738,6 +67773,13 @@ class WebGLTextureUtils {

gl.texImage2D( glTextureType, 0, glInternalFormat, glFormat, glType, options.image );

} else if ( texture.isHTMLTexture ) {

if ( typeof gl.texElementImage2D === 'function' ) {

gl.texElementImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, options.image );

}

} else {

Expand Down Expand Up @@ -72953,13 +72995,6 @@ class WebGPUTextureUtils {
*/
this._samplerCache = new Map();

/**
* A set of HTMLTextures that need paint updates.
*
* @type {Set<HTMLTexture>}
*/
this._htmlTextures = new Set();

}

/**
Expand Down Expand Up @@ -73222,8 +73257,6 @@ class WebGPUTextureUtils {

if ( textureData.msaaTexture !== undefined ) textureData.msaaTexture.destroy();

this._htmlTextures.delete( texture );

backend.delete( texture );

}
Expand Down Expand Up @@ -73441,14 +73474,10 @@ class WebGPUTextureUtils {

if ( typeof device.queue.copyElementImageToTexture !== 'function' ) return;

// Set up paint callback if not already done.
// Skip the first frame — the element needs a paint record first.
if ( ! textureData.hasPaintCallback ) {

textureData.hasPaintCallback = true;

this._addHTMLTexture( texture );

// Wait for the browser to paint the element before uploading.
canvas.requestPaint();
return;

Expand Down Expand Up @@ -73558,46 +73587,12 @@ class WebGPUTextureUtils {

}

/**
* Registers an HTMLTexture for paint updates.
* Sets up a single shared `onpaint` handler on the canvas
* that notifies all registered HTMLTextures.
*
* @private
* @param {HTMLTexture} texture - The HTMLTexture to register.
*/
_addHTMLTexture( texture ) {

this._htmlTextures.add( texture );

const canvas = this.backend.renderer.domElement;
const htmlTextures = this._htmlTextures;

canvas.onpaint = ( event ) => {

const changed = event.changedElements;

for ( const t of htmlTextures ) {

if ( changed.includes( t.image ) ) {

t.needsUpdate = true;

}

}

};

}

/**
* Frees all internal resources.
*/
dispose() {

this._samplerCache.clear();
this._htmlTextures.clear();

}

Expand Down
2 changes: 1 addition & 1 deletion build/three.webgpu.min.js

Large diffs are not rendered by default.

99 changes: 47 additions & 52 deletions build/three.webgpu.nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33593,6 +33593,13 @@ class Textures extends DataMap {
*/
this.info = info;

/**
* A set of HTMLTextures that need paint updates.
*
* @type {Set<HTMLTexture>}
*/
this._htmlTextures = new Set();

}

/**
Expand Down Expand Up @@ -33785,6 +33792,32 @@ class Textures extends DataMap {

}

// Set up shared paint callback for all HTMLTextures.

if ( this._htmlTextures.size === 0 ) {

const htmlTextures = this._htmlTextures;

canvas.onpaint = ( event ) => {

const changed = event && event.changedElements;

for ( const t of htmlTextures ) {

if ( ! changed || changed.includes( t.image ) ) {

t.needsUpdate = true;

}

}

};

}

this._htmlTextures.add( texture );

}

}
Expand Down Expand Up @@ -34126,6 +34159,8 @@ class Textures extends DataMap {

}

this._htmlTextures.delete( texture );

this.delete( texture );

this.info.destroyTexture( texture );
Expand Down Expand Up @@ -63132,23 +63167,23 @@ ${ flowData.code }

if ( offsetSnippet ) {

snippet = `texelFetchOffset( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), ${ levelSnippet }, ${ offsetSnippet } )`;
snippet = `texelFetchOffset( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), int( ${ levelSnippet } ), ${ offsetSnippet } )`;

} else {

snippet = `texelFetch( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), ${ levelSnippet } )`;
snippet = `texelFetch( ${ textureProperty }, ivec3( ${ uvIndexSnippet }, ${ depthSnippet } ), int( ${ levelSnippet } ) )`;

}

} else {

if ( offsetSnippet ) {

snippet = `texelFetchOffset( ${ textureProperty }, ${ uvIndexSnippet }, ${ levelSnippet }, ${ offsetSnippet } )`;
snippet = `texelFetchOffset( ${ textureProperty }, ${ uvIndexSnippet }, int( ${ levelSnippet } ), ${ offsetSnippet } )`;

} else {

snippet = `texelFetch( ${ textureProperty }, ${ uvIndexSnippet }, ${ levelSnippet } )`;
snippet = `texelFetch( ${ textureProperty }, ${ uvIndexSnippet }, int( ${ levelSnippet } ) )`;

}

Expand Down Expand Up @@ -67738,6 +67773,13 @@ class WebGLTextureUtils {

gl.texImage2D( glTextureType, 0, glInternalFormat, glFormat, glType, options.image );

} else if ( texture.isHTMLTexture ) {

if ( typeof gl.texElementImage2D === 'function' ) {

gl.texElementImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, options.image );

}

} else {

Expand Down Expand Up @@ -72953,13 +72995,6 @@ class WebGPUTextureUtils {
*/
this._samplerCache = new Map();

/**
* A set of HTMLTextures that need paint updates.
*
* @type {Set<HTMLTexture>}
*/
this._htmlTextures = new Set();

}

/**
Expand Down Expand Up @@ -73222,8 +73257,6 @@ class WebGPUTextureUtils {

if ( textureData.msaaTexture !== undefined ) textureData.msaaTexture.destroy();

this._htmlTextures.delete( texture );

backend.delete( texture );

}
Expand Down Expand Up @@ -73441,14 +73474,10 @@ class WebGPUTextureUtils {

if ( typeof device.queue.copyElementImageToTexture !== 'function' ) return;

// Set up paint callback if not already done.
// Skip the first frame — the element needs a paint record first.
if ( ! textureData.hasPaintCallback ) {

textureData.hasPaintCallback = true;

this._addHTMLTexture( texture );

// Wait for the browser to paint the element before uploading.
canvas.requestPaint();
return;

Expand Down Expand Up @@ -73558,46 +73587,12 @@ class WebGPUTextureUtils {

}

/**
* Registers an HTMLTexture for paint updates.
* Sets up a single shared `onpaint` handler on the canvas
* that notifies all registered HTMLTextures.
*
* @private
* @param {HTMLTexture} texture - The HTMLTexture to register.
*/
_addHTMLTexture( texture ) {

this._htmlTextures.add( texture );

const canvas = this.backend.renderer.domElement;
const htmlTextures = this._htmlTextures;

canvas.onpaint = ( event ) => {

const changed = event.changedElements;

for ( const t of htmlTextures ) {

if ( changed.includes( t.image ) ) {

t.needsUpdate = true;

}

}

};

}

/**
* Frees all internal resources.
*/
dispose() {

this._samplerCache.clear();
this._htmlTextures.clear();

}

Expand Down
Loading
Loading