Skip to content

Commit

Permalink
Merge branch 'mrdoob:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiri0 authored Jan 15, 2025
2 parents 38eea72 + d9ca4dc commit e909a77
Show file tree
Hide file tree
Showing 463 changed files with 58,924 additions and 5,375 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"CodeMirror": "readonly",
"esprima": "readonly",
"jsonlint": "readonly",
"VideoFrame": "readonly"
"VideoFrame": "readonly",
"VideoDecoder": "readonly"
},
"rules": {
"no-throw-literal": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- name: === E2E testing ===
run: npm run test-e2e
- name: Upload output screenshots
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
if: always()
with:
name: Output screenshots-${{ matrix.os }}-${{ matrix.CI }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql-config.yml
queries: security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3
uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/read-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
# write the output in a json file to upload it as artifact
node -pe "JSON.stringify({ filesize: $WEBGL_FILESIZE, gzip: $WEBGL_FILESIZE_GZIP, treeshaken: $WEBGL_TREESHAKEN, treeshakenGzip: $WEBGL_TREESHAKEN_GZIP, filesize2: $WEBGPU_FILESIZE, gzip2: $WEBGPU_FILESIZE_GZIP, treeshaken2: $WEBGPU_TREESHAKEN, treeshakenGzip2: $WEBGPU_TREESHAKEN_GZIP, filesize3: $WEBGPU_NODES_FILESIZE, gzip3: $WEBGPU_NODES_FILESIZE_GZIP, treeshaken3: $WEBGPU_NODES_TREESHAKEN, treeshakenGzip3: $WEBGPU_NODES_TREESHAKEN_GZIP, pr: $PR })" > sizes.json
- name: Upload artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
name: sizes
path: sizes.json
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright © 2010-2024 three.js authors
Copyright © 2010-2025 three.js authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#### JavaScript 3D library

The aim of the project is to create an easy-to-use, lightweight, cross-browser, general-purpose 3D library. The current builds only include a WebGL renderer but WebGPU (experimental), SVG and CSS3D renderers are also available as addons.
The aim of the project is to create an easy-to-use, lightweight, cross-browser, general-purpose 3D library. The current builds only include WebGL and WebGPU renderers but SVG and CSS3D renderers are also available as addons.

[Examples](https://threejs.org/examples/) —
[Docs](https://threejs.org/docs/) —
Expand Down
156 changes: 129 additions & 27 deletions build/three.cjs

Large diffs are not rendered by default.

116 changes: 94 additions & 22 deletions build/three.core.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/three.core.min.js

Large diffs are not rendered by default.

43 changes: 35 additions & 8 deletions build/three.module.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/three.module.min.js

Large diffs are not rendered by default.

24 changes: 16 additions & 8 deletions build/three.tsl.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/three.tsl.min.js

Large diffs are not rendered by default.

19,077 changes: 17,823 additions & 1,254 deletions build/three.webgpu.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/three.webgpu.min.js

Large diffs are not rendered by default.

19,077 changes: 17,823 additions & 1,254 deletions build/three.webgpu.nodes.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/three.webgpu.nodes.min.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/api/ar/materials/MeshNormalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ <h3>[property:Boolean flatShading]</h3>
تحديد ما إذا كان يتم عرض المادة بظلال مسطحة. الافتراضي هو خطأ.
</p>

<h3>[property:Boolean fog]</h3>
<p>ما إذا كانت المادة متأثرة بالضباب. الافتراضي هو `false`.</p>

<h3>[property:Texture normalMap]</h3>
<p>
النسيج لإنشاء خريطة طبيعية. تؤثر قيم RGB على السطح الطبيعي لكل قطعة بكسل وتغير طريقة إضاءة اللون. لا تغير خرائط العادية شكل السطح الفعلي ، فقط الإضاءة. في حال كانت المادة تحتوي على خريطة طبيعية مؤلفة باستخدام اتفاقية اليد اليسرى ، يجب إنكار مكون y من normalScale للتعويض عن اختلاف التوجه.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/animation/AnimationObjectGroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h3>[property:Boolean isAnimationObjectGroup]</h3>

<h3>[property:Object stats]</h3>
<p>
An object that contains some informations of this `AnimationObjectGroup`
An object that contains information of this `AnimationObjectGroup`
(total number, number in use, number of bindings per object)
</p>

Expand Down
3 changes: 3 additions & 0 deletions docs/api/en/core/BufferAttribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ <h3>[property:Number gpuType]</h3>
<h3>[property:Boolean isBufferAttribute]</h3>
<p>Read-only flag to check if a given object is of type [name].</p>

<h3>[property:Integer id]</h3>
<p>Unique number for this attribute instance.</p>

<h3>[property:Integer itemSize]</h3>
<p>
The length of vectors that are being stored in the
Expand Down
4 changes: 3 additions & 1 deletion docs/api/en/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ <h3>
<p>
An optional callback that is executed immediately before the shader
program is compiled. This function is called with the shader source code
as a parameter. Useful for the modification of built-in materials.
as a parameter. Useful for the modification of built-in materials, but the
recommended approach moving forward is to use `WebGPURenderer` with the new
Node Material system and [link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language TSL].
</p>
<p>
Unlike properties, the callback is not supported by [page:Material.clone .clone](),
Expand Down
3 changes: 0 additions & 3 deletions docs/api/en/materials/MeshNormalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ <h3>[property:Boolean flatShading]</h3>
false.
</p>

<h3>[property:Boolean fog]</h3>
<p>Whether the material is affected by fog. Default is `false`.</p>

<h3>[property:Texture normalMap]</h3>
<p>
The texture to create a normal map. The RGB values affect the surface
Expand Down
4 changes: 2 additions & 2 deletions docs/api/en/math/Matrix4.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ <h3>
[method:this lookAt]( [param:Vector3 eye], [param:Vector3 target], [param:Vector3 up] )
</h3>
<p>
Constructs a rotation matrix, looking from [page:Vector3 eye] towards
[page:Vector3 target] oriented by the [page:Vector3 up] vector.
Sets the rotation component of the transformation matrix, looking from [page:Vector3 eye] towards
[page:Vector3 target], and oriented by the up-direction [page:Vector3 up].
</p>

<h3>
Expand Down
5 changes: 1 addition & 4 deletions docs/api/en/textures/Texture.html
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,7 @@ <h3>[method:undefined updateMatrix]()</h3>
<h3>[method:Texture clone]()</h3>
<p>
Make copy of the texture. Note this is not a "deep copy", the image is
shared. Besides, cloning a texture does not automatically mark it for a
texture upload. You have to set [page:Texture.needsUpdate .needsUpdate] to
true as soon as its image property (the data source) is fully loaded or
ready.
shared. Cloning the texture automatically marks it for texture upload.
</p>

<h3>[method:Object toJSON]( [param:Object meta] )</h3>
Expand Down
98 changes: 98 additions & 0 deletions docs/api/en/textures/VideoFrameTexture.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:VideoTexture] &rarr;

<h1>[name]</h1>

<p class="desc">
This class can be used as an alternative way to define video data. Instead of using
an instance of `HTMLVideoElement` like with `VideoTexture`, [name] expects each frame is
defined manaully via [page:.setFrame setFrame](). A typical use case for this module is when
video frames are decoded with the WebCodecs API.
</p>

<h2>Code Example</h2>

<code>
const texture = new THREE.VideoFrameTexture();
texture.setFrame( frame );
</code>

<h2>Examples</h2>

<p>
[example:webgpu_video_frame video / frame]
</p>

<h2>Constructor</h2>
<h3>
[name]( [param:Constant mapping], [param:Constant wrapS],
[param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter],
[param:Constant format], [param:Constant type], [param:Number anisotropy] )
</h3>
<p>
[page:Constant mapping] -- How the image is applied to the object. An
object type of [page:Textures THREE.UVMapping].
See [page:Textures mapping constants] for other choices.<br />

[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for
other choices.<br />

[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for
other choices.<br />

[page:Constant magFilter] -- How the texture is sampled when a texel
covers more than one pixel. The default is [page:Textures THREE.LinearFilter].
See [page:Textures magnification filter constants]
for other choices.<br />

[page:Constant minFilter] -- How the texture is sampled when a texel
covers less than one pixel. The default is [page:Textures THREE.LinearFilter].
See [page:Textures minification filter constants] for
other choices.<br />

[page:Constant format] -- The default is [page:Textures THREE.RGBAFormat].
See [page:Textures format constants] for other choices.<br />

[page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
See [page:Textures type constants] for other choices.<br />

[page:Number anisotropy] -- The number of samples taken along the axis
through the pixel that has the highest density of texels. By default, this
value is `1`. A higher value gives a less blurry result than a basic mipmap,
at the cost of more texture samples being used. Use
[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find
the maximum valid anisotropy value for the GPU; this value is usually a
power of 2.<br /><br />
</p>

<h2>Properties</h2>

<p>See the base [page:VideoTexture VideoTexture] class for common properties.</p>

<h2>Methods</h2>

<p>See the base [page:VideoTexture VideoTexture] class for common methods.</p>

<h3>[method:undefined setFrame]( [param:VideoFrame frame] )</h3>
<p>
Sets the current frame of the video. This will automatically update the texture
so the data can be used for rendering.
</p>

<h2>Source</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>
4 changes: 2 additions & 2 deletions docs/api/fr/constants/Textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ <h2>Modes d'emballage</h2>
Ces constantes définissent les propriétés des textures [page:Texture.wrapS wrapS] et [page:Texture.wrapT wrapT],
qui définissent l'emballage de texture horizontal et vertical.<br /><br />

Avec [page:constant RepeatWrapping] la texure se répétera simplement à l'infini.<br /><br />
Avec [page:constant RepeatWrapping] la texture se répétera simplement à l'infini.<br /><br />

[page:constant ClampToEdgeWrapping] est la valeur par défaut.
Le dernier pixel de la texture s'étend jusqu'au bord du maillage.<br /><br />

Avec [page:constant MirroredRepeatWrapping] la texure se répétera à l'infini avec un effet miroir à chaque répétition.
Avec [page:constant MirroredRepeatWrapping] la texture se répétera à l'infini avec un effet miroir à chaque répétition.
</p>

<h2>Filtres de grossissement</h2>
Expand Down
4 changes: 3 additions & 1 deletion docs/api/fr/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ <h3>[method:undefined dispose]()</h3>
<h3>[method:undefined onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] )</h3>
<p>
Un callback facultatif qui est exécuté immédiatement avant la compilation du programme shader.
Cette fonction est appelée avec le code source du shader comme paramètre. Utile pour la modification des matériaux intégrés.
Cette fonction est appelée avec le code source du shader comme paramètre. Utile pour la modification des matériaux intégrés,
bien que la nouvelle méthode recommandée soit d'utiliser `WebGPURenderer` avec le nouveau système de Node Material et
[link:https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language TSL].
</p>
<p>
Contrairement aux propriétés, le callback n'est pas pris en charge par [page:Material.clone .clone](), [page:Material.copy .copy]() et [page:Material.toJSON .toJSON]().
Expand Down
3 changes: 0 additions & 3 deletions docs/api/fr/materials/MeshNormalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ <h3>[property:Boolean flatShading]</h3>
Définit si le matériau est rendu avec un ombrage plat. La valeur par défaut est false.
</p>

<h3>[property:Boolean fog]</h3>
<p>Si le matériau est affecté par le brouillard (fog) La valeur par défaut est `false`.</p>

<h3>[property:Texture normalMap]</h3>
<p>
La texture pour créer une carte normale. Les valeurs RVB affectent la surface normale pour chaque fragment de pixel et changent
Expand Down
3 changes: 0 additions & 3 deletions docs/api/it/materials/MeshNormalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ <h3>[property:Boolean flatShading]</h3>
Definisce se il materiale viene renderizzato con un'ombreggiatura piatta. Il valore predefinito è `false`.
</p>

<h3>[property:Boolean fog]</h3>
<p>Indica se il materiale è influenzato dalla nebbia. Il valore predefinito è `false`.</p>

<h3>[property:Texture normalMap]</h3>
<p>
La texture per creare una mappa normale. I valori RGB influenzano la normale della superficie per ogni frammento di pixel
Expand Down
28 changes: 14 additions & 14 deletions docs/api/it/textures/Texture.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>[name]</h1>
</p>

<p>
Nota: Dopo l'utilizzo iniziale di una texture, le sue dimensioni, formato, e il tipo non possono essere cambiati.
Nota: Dopo l'utilizzo iniziale di una texture, le sue dimensioni, formato, e il tipo non possono essere cambiati.
Invece, chiama [page:.dispose]() sulla texture e creane una nuova.
</p>

Expand Down Expand Up @@ -61,8 +61,8 @@ <h3>[property:Image image]</h3>
Questo può essere qualsiasi tipo di immagine (e.g., PNG, JPG, GIF, DDS) o video (e.g., MP4, OGG/OGV) supportato da three.js.<br /><br />

Per utilizzare il video come texture è necessario disporre di un elemento video HTML5
in riproduzione come sorgente per l'immagine della texture e aggiornare
continuamente questa texture finchè il video è in riproduzione -
in riproduzione come sorgente per l'immagine della texture e aggiornare
continuamente questa texture finchè il video è in riproduzione -
la classe [page:VideoTexture VideoTexture] gestisce questa operazione automaticamente.
</p>

Expand All @@ -88,7 +88,7 @@ <h3>[property:number wrapS]</h3>
<p>
Questo definisce come la texture è wrappata orizzontalmente e corrisponde a *U* nel mapping UV.<br />
L'impostazione predefinita è [page:Textures THREE.ClampToEdgeWrapping], dove il bordo è fissato ai texel del bordo esterno.
Le altre due scelte sono [page:Textures THREE.RepeatWrapping] e [page:Textures THREE.MirroredRepeatWrapping].
Le altre due scelte sono [page:Textures THREE.RepeatWrapping] e [page:Textures THREE.MirroredRepeatWrapping].
Vedi la pagina [page:Textures texture constants] per i dettagli.
</p>

Expand Down Expand Up @@ -122,7 +122,7 @@ <h3>[property:number minFilter]</h3>
<h3>[property:number anisotropy]</h3>
<p>
Il numero di campioni prelevati lungo l'asse attravero il pixel che ha la densità di texel più alta.
Per impostazione predefinita, questo valore è 1. Un valore più alto fornisce un risultato meno sfuocato rispetto ad una mipmap di base,
Per impostazione predefinita, questo valore è 1. Un valore più alto fornisce un risultato meno sfuocato rispetto ad una mipmap di base,
a costo di utilizzare più campioni di texture. Usa [page:WebGLRenderer.capabilities renderer.capabilities.getMaxAnisotropy]()
per trovare il valore di anisotropia massimo valido per la GPU; questo valore è solitamente una potenza di 2.
</p>
Expand Down Expand Up @@ -160,7 +160,7 @@ <h3>[property:Vector2 offset]</h3>

<h3>[property:Vector2 repeat]</h3>
<p>
Quante volte la texture è ripetuta sulla superficie, in ogni direzione U e V. Se la proprietà ripeat è
Quante volte la texture è ripetuta sulla superficie, in ogni direzione U e V. Se la proprietà ripeat è
impostata su un valore maggiore di 1 in entrambe le direzioni, anche il parametro Wrap corrispondente
deve essere impostato su [page:Textures THREE.RepeatWrapping] o [page:Textures THREE.MirroredRepeatWrapping] per ottenere l'effetto
di piastrellatura desiderato.
Expand All @@ -174,14 +174,14 @@ <h3>[property:number rotation]</h3>

<h3>[property:Vector2 center]</h3>
<p>
Il punto attorno al quale avviene la rotazione. Un valore (0.5, 0.5) che corrisponde al centro della texture. Il
Il punto attorno al quale avviene la rotazione. Un valore (0.5, 0.5) che corrisponde al centro della texture. Il
valore predefinito è (0, 0), in basso a sinistra.
</p>

<h3>[property:Boolean matrixAutoUpdate]</h3>
<p>
Indica se aggiornare la [page:Texture.matrix .matrix] uv-transform della texture dalle proprietà della texture
[page:Texture.offset .offset], [page:Texture.repeat .repeat], [page:Texture.rotation .rotation], e [page:Texture.center .center].
[page:Texture.offset .offset], [page:Texture.repeat .repeat], [page:Texture.rotation .rotation], e [page:Texture.center .center].
Il valore predefinito è `true`.
Impostalo a `false` se stai specificando la matrice uv-transform direttamente.
</p>
Expand All @@ -196,13 +196,13 @@ <h3>[property:Matrix3 matrix]</h3>

<h3>[property:Boolean generateMipmaps]</h3>
<p>
Indica se generare mipmap (se possibile) per una texure. Il valore predefinito è `true`.
Indica se generare mipmap (se possibile) per una texture. Il valore predefinito è `true`.
Impostalo a false se stai creando il mipmap manualmente.
</p>

<h3>[property:Boolean premultiplyAlpha]</h3>
<p>
Se impostato a `true`, il canale alfa, se presente, viene moltiplicato nei canali del colore
Se impostato a `true`, il canale alfa, se presente, viene moltiplicato nei canali del colore
quando la texture viene caricata sulla GPU. Il valore predefinito è `false`.<br /><br />

Si noti che questa proprietà non ha effetto per [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
Expand All @@ -220,7 +220,7 @@ <h3>[property:Boolean flipY]</h3>
<h3>[property:number unpackAlignment]</h3>
<p>
Il valore predefinito è 4. Specifica i requisiti di allineamento per l'inizio di ogni riga di pixel in memoria.
I valori consentiti sono 1 (allineamento di byte), 2 (righe allineate a byte pari), 4 (allineamento di parole)
I valori consentiti sono 1 (allineamento di byte), 2 (righe allineate a byte pari), 4 (allineamento di parole)
e 8 (le righe iniziano su limiti di doppia parola).
Vedi [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] per maggiori informazioni.
</p>
Expand Down Expand Up @@ -250,8 +250,8 @@ <h3>[property:Boolean needsUpdate]</h3>

<h3>[property:Object userData]</h3>
<p>
Un oggetto che può essere utilizzato per memorizzare dati personalizzati della texture.
Non deve contenere riferimenti a funzioni poiché queste non verranno clonate.
Un oggetto che può essere utilizzato per memorizzare dati personalizzati della texture.
Non deve contenere riferimenti a funzioni poiché queste non verranno clonate.
</p>

<h3>[property:Source source]</h3>
Expand Down Expand Up @@ -286,7 +286,7 @@ <h3>[method:Object toJSON]( [param:Object meta] )</h3>

<h3>[method:undefined dispose]()</h3>
<p>
Libera le risorse relative alla GPU allocate da questa istanza.
Libera le risorse relative alla GPU allocate da questa istanza.
Chiama questo metodo ogni volta che questa istanza non viene più utilizzata dall'applicazione.
</p>

Expand Down
Loading

0 comments on commit e909a77

Please sign in to comment.