Skip to content

Commit

Permalink
r166
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 28, 2024
1 parent d75d029 commit 1d780b8
Show file tree
Hide file tree
Showing 293 changed files with 7,316 additions and 2,385 deletions.
889 changes: 561 additions & 328 deletions build/three.cjs

Large diffs are not rendered by default.

889 changes: 560 additions & 329 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.

5 changes: 5 additions & 0 deletions docs/api/ar/lights/shadows/LightShadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ <h3>[property:Float bias]</h3>

<h3>[property:Integer blurSamples]</h3>
<p>عدد العينات المستخدمة عند طمس خريطة ظل VSM.</p>

<h3>[property:Float intensity]</h3>
<p>
The intensity of the shadow. The default is `1`. Valid values are in the range `[0, 1]`.
</p>

<h3>[property:WebGLRenderTarget map]</h3>
<p>
Expand Down
6 changes: 3 additions & 3 deletions docs/api/ar/materials/RawShaderMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ <h2>أمثلة (Examples)</h2>
[example:webgl_buffergeometry_instancing_billboards WebGL / buffergeometry / instancing / billboards]<br />
[example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]<br />
[example:webgl_raymarching_reflect WebGL / raymarching / reflect]<br />
[example:webgl2_volume_cloud WebGL 2 / volume / cloud]<br />
[example:webgl2_volume_instancing WebGL 2 / volume / instancing]<br />
[example:webgl2_volume_perlin WebGL 2 / volume / perlin]
[example:webgl_volume_cloud WebGL / volume / cloud]<br />
[example:webgl_volume_instancing WebGL / volume / instancing]<br />
[example:webgl_volume_perlin WebGL / volume / perlin]
</p>

<h2>المنشئ (Constructor)</h2>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/ar/renderers/WebGLArrayRenderTarget.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>[name]</h1>
<h2>أمثلة (Examples)</h2>

<p>
[example:webgl2_rendertarget_texture2darray WebGL 2 / render target / array]<br />
[example:webgl_rendertarget_texture2darray WebGL / render target / array]<br />
</p>

<h2>المنشئ (Constructor)</h2>
Expand Down
43 changes: 43 additions & 0 deletions docs/api/en/extras/TextureUtils.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!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>
<h1>[name]</h1>

<p class="desc">A class containing utility functions for textures.</p>

<h2>Methods</h2>

<h3>[method:Texture contain]( [param:Texture texture], [param:Number aspect] )</h3>
<p>
Scales the texture as large as possible within its surface without cropping or stretching the texture. The method preserves the original aspect ratio of the texture. Akin to CSS `object-fit: contain`.
</p>

<h3>[method:Texture cover]( [param:Texture texture], [param:Number aspect] )</h3>
<p>
Scales the texture to the smallest possible size to fill the surface, leaving no empty space. The method preserves the original aspect ratio of the texture. Akin to CSS `object-fit: cover`.
</p>

<h3>[method:Texture fill]( [param:Texture texture] )</h3>
<p>
Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.
</p>

<h3>[method:Number getByteLength]( [param:Number width], [param:Number height], [param:Number format], [param:Number type] )</h3>
<p>
Given the width, height, format, and type of a texture. Determines how
many bytes must be used to represent the texture.
</p>

<h2>Source</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>
5 changes: 5 additions & 0 deletions docs/api/en/lights/shadows/LightShadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ <h3>[property:Float bias]</h3>
<h3>[property:Integer blurSamples]</h3>
<p>The amount of samples to use when blurring a VSM shadow map.</p>

<h3>[property:Float intensity]</h3>
<p>
The intensity of the shadow. The default is `1`. Valid values are in the range `[0, 1]`.
</p>

<h3>[property:WebGLRenderTarget map]</h3>
<p>
The depth map generated using the internal camera; a location beyond a
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ <h3>[method:undefined dispose]()</h3>
method whenever this instance is no longer used in your app.
</p>
<p>
Material textures must be be disposed of by the dispose() method of
Material textures must be disposed of by the dispose() method of
[page:Texture Texture].
</p>

Expand Down
6 changes: 3 additions & 3 deletions docs/api/en/materials/RawShaderMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ <h2>Examples</h2>
[example:webgl_buffergeometry_instancing_billboards WebGL / buffergeometry / instancing / billboards]<br />
[example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]<br />
[example:webgl_raymarching_reflect WebGL / raymarching / reflect]<br />
[example:webgl2_volume_cloud WebGL 2 / volume / cloud]<br />
[example:webgl2_volume_instancing WebGL 2 / volume / instancing]<br />
[example:webgl2_volume_perlin WebGL 2 / volume / perlin]
[example:webgl_volume_cloud WebGL / volume / cloud]<br />
[example:webgl_volume_instancing WebGL / volume / instancing]<br />
[example:webgl_volume_perlin WebGL / volume / perlin]
</p>

<h2>Constructor</h2>
Expand Down
6 changes: 6 additions & 0 deletions docs/api/en/math/Vector4.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@ <h3>[method:this setAxisAngleFromRotationMatrix]( [param:Matrix4 m] )</h3>
and [page:.w w] to the angle.
</p>

<h3>[method:this setFromMatrixPosition]( [param:Matrix4 m] )</h3>
<p>
Sets this vector to the position elements of the
[link:https://en.wikipedia.org/wiki/Transformation_matrix transformation matrix] [page:Matrix4 m].
</p>

<h3>
[method:this setComponent]( [param:Integer index], [param:Float value] )
</h3>
Expand Down
110 changes: 63 additions & 47 deletions docs/api/en/objects/BatchedMesh.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,42 @@ <h1>[name]</h1>
<p class="desc">
A special version of [page:Mesh] with multi draw batch rendering support. Use
[name] if you have to render a large number of objects with the same
material but with different world transformations and geometry. The usage
of [name] will help you to reduce the number of draw calls and thus
improve the overall rendering performance in your application.
material but with different world transformations. The usage of [name] will
help you to reduce the number of draw calls and thus improve the overall
rendering performance in your application.

<br/>
<br/>

If the [link:https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw WEBGL_multi_draw extension] is
not supported then a less performant callback is used.
not supported then a less performant fallback is used.
</p>

<h2>Code Example</h2>

<code>
const box = new THREE.BoxGeometry( 1, 1, 1 );
const sphere = new THREE.BoxGeometry( 1, 1, 1 );
const sphere = new THREE.SphereGeometry( 1, 12, 12 );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );

// initialize and add geometries into the batched mesh
const batchedMesh = new BatchedMesh( 10, 5000, 10000, material );
const boxId = batchedMesh.addGeometry( box );
const sphereId = batchedMesh.addGeometry( sphere );
const boxGeometryId = batchedMesh.addGeometry( box );
const sphereGeometryId = batchedMesh.addGeometry( sphere );

// create instances of those geometries
const boxInstancedId1 = batchedMesh.addInstance( boxGeometryId );
const boxInstancedId2 = batchedMesh.addInstance( boxGeometryId );

const sphereInstancedId1 = batchedMesh.addInstance( sphereGeometryId );
const sphereInstancedId2 = batchedMesh.addInstance( sphereGeometryId );

// position the geometries
batchedMesh.setMatrixAt( boxId, boxMatrix );
batchedMesh.setMatrixAt( sphereId, sphereMatrix );
batchedMesh.setMatrixAt( boxInstancedId1, boxMatrix1 );
batchedMesh.setMatrixAt( boxInstancedId2, boxMatrix2 );

batchedMesh.setMatrixAt( sphereInstancedId1, sphereMatrix1 );
batchedMesh.setMatrixAt( sphereInstancedId2, sphereMatrix2 );

scene.add( batchedMesh );
</code>
Expand All @@ -52,16 +62,15 @@ <h2>Examples</h2>
<h2>Constructor</h2>
<h3>
[name](
[param:Integer maxGeometryCount], [param:Integer maxVertexCount],
[param:Integer maxInstanceCount], [param:Integer maxVertexCount],
[param:Integer maxIndexCount], [param:Material material],
)
</h3>
<p>
[page:Integer maxGeometryCount] - the max number of individual geometries planned to be added.<br />
[page:Integer maxVertexCount] - the max number of vertices to be used by all geometries.<br />
[page:Integer maxIndexCount] - the max number of indices to be used by all geometries.<br />
[page:Material material] - an instance of [page:Material]. Default is a
new [page:MeshBasicMaterial].<br />
[page:Integer maxInstanceCount] - the max number of individual instances planned to be added and rendered.<br />
[page:Integer maxVertexCount] - the max number of vertices to be used by all unique geometries.<br />
[page:Integer maxIndexCount] - the max number of indices to be used by all unique geometries.<br />
[page:Material material] - an instance of [page:Material]. Default is a new [page:MeshBasicMaterial].<br />
</p>

<h2>Properties</h2>
Expand Down Expand Up @@ -91,9 +100,9 @@ <h3>[property:Boolean sortObjects]</h3>
rendered front to back. Default is `true`.
</p>

<h3>[property:Integer maxGeometryCount]</h3>
<h3>[property:Integer maxInstanceCount]</h3>
<p>
The maximum number of individual geometries that can be stored in the [name]. Read only.
The maximum number of individual instances that can be stored in the [name]. Read only.
</p>

<h3>[property:Boolean isBatchedMesh]</h3>
Expand Down Expand Up @@ -125,63 +134,57 @@ <h3>[method:undefined dispose]()</h3>

<h3>[method:this setCustomSort]( [param:Function sortFunction] )</h3>
<p>
Takes a sort a function that is run before render. The function takes a list of items to sort and a camera. The objects
Takes a sort a function that is run before render. The function takes a list of instances to sort and a camera. The objects
in the list include a "z" field to perform a depth-ordered sort with.
</p>

<h3>
[method:undefined getColorAt]( [param:Integer index], [param:Color color] )
[method:undefined getColorAt]( [param:Integer instanceId], [param:Color target] )
</h3>
<p>
[page:Integer index]: The index of a geometry. Values have to be in the
range [0, count].
[page:Integer instanceId]: The id of an instance to get the color of.
</p>
<p>
[page:Color color]: This color object will be set to the color of the
defined geometry.
[page:Color target]: The target object to copy the color in to.
</p>
<p>Get the color of the defined geometry.</p>

<h3>
[method:Matrix4 getMatrixAt]( [param:Integer index], [param:Matrix4 matrix] )
[method:Matrix4 getMatrixAt]( [param:Integer instanceId], [param:Matrix4 target] )
</h3>
<p>
[page:Integer index]: The index of an instance. Values have to be in the
range [0, count].
[page:Integer instanceId]: The id of an instance to get the matrix of.
</p>
<p>
[page:Matrix4 matrix]: This 4x4 matrix will be set to the local
[page:Matrix4 target]: This 4x4 matrix will be set to the local
transformation matrix of the defined instance.
</p>
<p>Get the local transformation matrix of the defined instance.</p>

<h3>
[method:Boolean getVisibleAt]( [param:Integer index] )
[method:Boolean getVisibleAt]( [param:Integer instanceId] )
</h3>
<p>
[page:Integer index]: The index of an instance. Values have to be in the
range [0, count].
[page:Integer instanceId]: The id of an instance to get the visibility state of.
</p>
<p>Get whether the given instance is marked as "visible" or not.</p>

<h3>
[method:undefined setColorAt]( [param:Integer index], [param:Color color] )
[method:undefined setColorAt]( [param:Integer instanceId], [param:Color color] )
</h3>
<p>
[page:Integer index]: The index of a geometry. Values have to be in the
range [0, count].
[page:Integer instanceId]: The id of the instance to set the color of.
</p>
<p>[page:Color color]: The color of a single geometry.</p>
<p>[page:Color color]: The color to set the instance to.</p>
<p>
Sets the given color to the defined geometry.
Sets the given color to the defined geometry instance.
</p>

<h3>
[method:this setMatrixAt]( [param:Integer index], [param:Matrix4 matrix] )
[method:this setMatrixAt]( [param:Integer instanceId], [param:Matrix4 matrix] )
</h3>
<p>
[page:Integer index]: The index of an instance. Values have to be in the
range [0, count].
[page:Integer instanceId]: The id of an instance to set the matrix of.
</p>
<p>
[page:Matrix4 matrix]: A 4x4 matrix representing the local transformation
Expand All @@ -192,17 +195,16 @@ <h3>
</p>

<h3>
[method:this setVisibleAt]( [param:Integer index], [param:Boolean visible] )
[method:this setVisibleAt]( [param:Integer instanceId], [param:Boolean visible] )
</h3>
<p>
[page:Integer index]: The index of an instance. Values have to be in the
range [0, count].
[page:Integer instanceId]: The id of the instance to set the visibility of.
</p>
<p>
[page:Boolean visible]: A boolean value indicating the visibility state.
</p>
<p>
Sets the visibility of the object at the given index.
Sets the visibility of the instance at the given index.
</p>

<h3>
Expand All @@ -222,22 +224,35 @@ <h3>
the length of the given geometry index buffer.
</p>
<p>
Adds the given geometry to the [name] and returns the associated index referring to it.
Adds the given geometry to the [name] and returns the associated geometry id referring to it to be used in other functions.
</p>

<h3>
[method:Integer addInstance]( [param:Integer geometryId] )
</h3>
<p>
[page:Integer geometryId]: The id of a previously added geometry via "addGeometry" to add into the [name] to render.
</p>
<p>
Adds a new instance to the [name] using the geometry of the given geometryId and returns a new id referring to the new instance to be used
by other functions.
</p>

<h3>
[method:Integer setGeometryAt]( [param:Integer index], [param:BufferGeometry geometry] )
[method:Integer setGeometryAt]( [param:Integer geometryId], [param:BufferGeometry geometry] )
</h3>
<p>
[page:Integer index]: Which geometry index to replace with this geometry.
[page:Integer geometryId]: Which geometry id to replace with this geometry.
</p>
<p>
[page:BufferGeometry geometry]: The geometry to substitute at the given geometry index.
[page:BufferGeometry geometry]: The geometry to substitute at the given geometry id.
</p>
<p>
Replaces the geometry at `index` with the provided geometry. Throws an error if there is not enough space reserved for geometry at the index.
Replaces the geometry at `geometryId` with the provided geometry. Throws an error if there is not enough space reserved for geometry.
Calling this will change all instances that are rendering that geometry.
</p>

<!--
<h3>
[method:Integer getInstanceCountAt]( [param:Integer index] )
</h3>
Expand All @@ -261,6 +276,7 @@ <h3>
<p>
Sets an instance count of the geometry at `index`.
</p>
-->

<h2>Source</h2>

Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/renderers/WebGLArrayRenderTarget.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>[name]</h1>
<h2>Examples</h2>

<p>
[example:webgl2_rendertarget_texture2darray WebGL 2 / render target / array]<br />
[example:webgl_rendertarget_texture2darray WebGL / render target / array]<br />
</p>

<h2>Constructor</h2>
Expand Down
8 changes: 4 additions & 4 deletions docs/api/en/textures/Data3DTexture.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ <h2>Code Example</h2>
<h2>Examples</h2>

<p>
[example:webgl2_materials_texture3d WebGL2 / materials / texture3d]<br />
[example:webgl2_materials_texture3d_partialupdate WebGL2 / materials / texture3d / partialupdate]<br />
[example:webgl2_volume_cloud WebGL2 / volume / cloud]<br />
[example:webgl2_volume_perlin WebGL2 / volume / perlin]
[example:webgl_texture3d WebGL / texture3d]<br />
[example:webgl_texture3d_partialupdate WebGL / texture3d / partialupdate]<br />
[example:webgl_volume_cloud WebGL / volume / cloud]<br />
[example:webgl_volume_perlin WebGL / volume / perlin]
</p>

<h2>Properties</h2>
Expand Down
4 changes: 2 additions & 2 deletions docs/api/en/textures/DataArrayTexture.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ <h2>Code Example</h2>
<h2>Examples</h2>

<p>
[example:webgl2_materials_texture2darray WebGL2 / materials / texture2darray]
[example:webgl2_rendertarget_texture2darray WebGL2 / rendertarget / texture2darray]
[example:webgl_texture2darray WebGL / texture2darray]<br />
[example:webgl_rendertarget_texture2darray WebGL / rendertarget / texture2darray]
</p>

<h2>Properties</h2>
Expand Down
Loading

0 comments on commit 1d780b8

Please sign in to comment.