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
4 changes: 2 additions & 2 deletions build/three.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -10786,7 +10786,7 @@ class Sphere {
* Returns a serialized structure of the bounding sphere.
*
* @param {Object} json - The serialized json to set the sphere from.
* @return {Box3} A reference to this bounding sphere.
* @return {Sphere} A reference to this bounding sphere.
*/
fromJSON( json ) {

Expand Down
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion build/three.webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -36519,7 +36519,7 @@ const interleavedGradientNoise = Fn( ( [ position ] ) => {
const vogelDiskSample = Fn( ( [ sampleIndex, samplesCount, phi ] ) => {

const goldenAngle = float( 2.399963229728653 ); // 2π * (2 - φ) where φ is golden ratio
const r = sqrt( float( sampleIndex ).add( 0.5 ) ).div( sqrt( float( samplesCount ) ) );
const r = sqrt( float( sampleIndex ).add( 0.5 ).div( float( samplesCount ) ) );
const theta = float( sampleIndex ).mul( goldenAngle ).add( phi );
return vec2( cos( theta ), sin( theta ) ).mul( r );

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.webgpu.nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -36519,7 +36519,7 @@ const interleavedGradientNoise = Fn( ( [ position ] ) => {
const vogelDiskSample = Fn( ( [ sampleIndex, samplesCount, phi ] ) => {

const goldenAngle = float( 2.399963229728653 ); // 2π * (2 - φ) where φ is golden ratio
const r = sqrt( float( sampleIndex ).add( 0.5 ) ).div( sqrt( float( samplesCount ) ) );
const r = sqrt( float( sampleIndex ).add( 0.5 ).div( float( samplesCount ) ) );
const theta = float( sampleIndex ).mul( goldenAngle ).add( phi );
return vec2( cos( theta ), sin( theta ) ).mul( r );

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

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,8 @@ <h2>TSL</h2>
<li><a href="TSL.html#buffer">buffer</a></li>
<li><a href="TSL.html#bufferAttribute">bufferAttribute</a></li>
<li><a href="TSL.html#builtin">builtin</a></li>
<li><a href="TSL.html#builtinAOContext">builtinAOContext</a></li>
<li><a href="TSL.html#builtinShadowContext">builtinShadowContext</a></li>
<li><a href="TSL.html#bumpMap">bumpMap</a></li>
<li><a href="TSL.html#burn">burn</a></li>
<li><a href="TSL.html#bypass">bypass</a></li>
Expand Down Expand Up @@ -1497,6 +1499,7 @@ <h2>TSL</h2>
<li><a href="TSL.html#viewportSize">viewportSize</a></li>
<li><a href="TSL.html#viewportTexture">viewportTexture</a></li>
<li><a href="TSL.html#viewportUV">viewportUV</a></li>
<li><a href="TSL.html#vogelDiskSample">vogelDiskSample</a></li>
<li><a href="TSL.html#wgsl">wgsl</a></li>
<li><a href="TSL.html#workgroupArray">workgroupArray</a></li>
<li><a href="TSL.html#workgroupBarrier">workgroupBarrier</a></li>
Expand Down Expand Up @@ -1636,6 +1639,7 @@ <h2>Global</h2>
<li><a href="global.html#PCFShadowMap">PCFShadowMap</a></li>
<li><a href="global.html#PCFSoftShadowFilter">PCFSoftShadowFilter</a></li>
<li><a href="global.html#PCFSoftShadowMap">PCFSoftShadowMap</a></li>
<li><a href="global.html#PointShadowFilter">PointShadowFilter</a></li>
<li><a href="global.html#R11_EAC_Format">R11_EAC_Format</a></li>
<li><a href="global.html#RED_GREEN_RGTC2_Format">RED_GREEN_RGTC2_Format</a></li>
<li><a href="global.html#RED_RGTC1_Format">RED_RGTC1_Format</a></li>
Expand Down
19 changes: 18 additions & 1 deletion docs/pages/BufferGeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ <h3 class="name" id="indirect" translate="no">.<a href="#indirect">indirect</a><
<p>Default is <code>null</code>.</p>
</div>
</div>
<div class="member">
<h3 class="name" id="indirectOffset" translate="no">.<a href="#indirectOffset">indirectOffset</a><span class="type-signature"> : number</span> </h3>
<div class="description">
<p>The offset, in bytes, into the indirect drawing buffer where the value data begins.</p>
<p>Can only be used with <a href="WebGPURenderer.html">WebGPURenderer</a> and a WebGPU backend.</p>
<p>Default is <code>0</code>.</p>
</div>
</div>
<div class="member">
<h3 class="name" id="isBufferGeometry" translate="no">.<a href="#isBufferGeometry">isBufferGeometry</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
<div class="description">
Expand Down Expand Up @@ -644,7 +652,7 @@ <h3 class="name name-method" id="setIndex" translate="no">.<a href="#setIndex">s
<dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
</dl>
</div>
<h3 class="name name-method" id="setIndirect" translate="no">.<a href="#setIndirect">setIndirect</a><span class="signature">( indirect : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span><span class="type-signature"> : <a href="BufferGeometry.html">BufferGeometry</a></span> </h3>
<h3 class="name name-method" id="setIndirect" translate="no">.<a href="#setIndirect">setIndirect</a><span class="signature">( indirect : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span>, indirectOffset : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="BufferGeometry.html">BufferGeometry</a></span> </h3>
<div class="method">
<div class="description">
<p>Sets the given indirect attribute to this geometry.</p>
Expand All @@ -659,6 +667,15 @@ <h3 class="name name-method" id="setIndirect" translate="no">.<a href="#setIndir
<p>The attribute holding indirect draw calls.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>indirectOffset</strong>
</td>
<td class="description last">
<p>The offset, in bytes, into the indirect drawing buffer where the value data begins.</p>
<p>Default is <code>0</code>.</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/CubeTextureNode.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h3 class="name name-method" id="getDefaultUV" translate="no">.<a href="#getDefa
<h3 class="name name-method" id="getInputType" translate="no">.<a href="#getInputType">getInputType</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
<div class="method">
<div class="description">
<p>Overwrites the default implementation to return a fixed value <code>'cubeTexture'</code>.</p>
<p>Overwrites the default implementation to return the appropriate cube texture type.</p>
</div>
<table class="params">
<tbody>
Expand Down
39 changes: 30 additions & 9 deletions docs/pages/PointShadowNode.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,35 @@ <h3 class="name name-method" id="renderShadow" translate="no">.<a href="#renderS
<dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowNode.html#renderShadow">ShadowNode#renderShadow</a></dt>
</dl>
</div>
<h3 class="name name-method" id="setupRenderTarget" translate="no">.<a href="#setupRenderTarget">setupRenderTarget</a><span class="signature">( shadow : <span class="param-type"><a href="LightShadow.html">LightShadow</a></span>, builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : Object</span> </h3>
<div class="method">
<div class="description">
<p>Overwrites the default implementation to create a CubeRenderTarget with CubeDepthTexture.</p>
</div>
<table class="params">
<tbody>
<tr>
<td class="name">
<strong>shadow</strong>
</td>
<td class="description last">
<p>The light shadow object.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>builder</strong>
</td>
<td class="description last">
<p>A reference to the current node builder.</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-returns"><strong>Returns:</strong> An object containing the shadow map and depth texture.</dt>
</dl>
</div>
<h3 class="name name-method" id="setupShadowCoord" translate="no">.<a href="#setupShadowCoord">setupShadowCoord</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span>, shadowPosition : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec3></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec3></span> </h3>
<div class="method">
<div class="description">
Expand Down Expand Up @@ -158,20 +187,12 @@ <h3 class="name name-method" id="setupShadowFilter" translate="no">.<a href="#se
<p>This function defines the filtering type of the shadow map e.g. PCF.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>shadowTexture</strong>
</td>
<td class="description last">
<p>A reference to the shadow map's texture.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>depthTexture</strong>
</td>
<td class="description last">
<p>A reference to the shadow map's texture data.</p>
<p>A reference to the shadow map's depth texture.</p>
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/Sphere.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ <h3 class="name name-method" id="expandByPoint" translate="no">.<a href="#expand
<dt class="tag-returns"><strong>Returns:</strong> A reference to this sphere.</dt>
</dl>
</div>
<h3 class="name name-method" id="fromJSON" translate="no">.<a href="#fromJSON">fromJSON</a><span class="signature">( json : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Box3.html">Box3</a></span> </h3>
<h3 class="name name-method" id="fromJSON" translate="no">.<a href="#fromJSON">fromJSON</a><span class="signature">( json : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Sphere.html">Sphere</a></span> </h3>
<div class="method">
<div class="description">
<p>Returns a serialized structure of the bounding sphere.</p>
Expand Down
102 changes: 102 additions & 0 deletions docs/pages/TSL.html
Original file line number Diff line number Diff line change
Expand Up @@ -2734,6 +2734,68 @@ <h3 class="name name-method" id="builtin" translate="no">.<a href="#builtin">bui
</tbody>
</table>
</div>
<h3 class="name name-method" id="builtinAOContext" translate="no">.<a href="#builtinAOContext">builtinAOContext</a><span class="signature">( aoNode : <span class="param-type"><a href="Node.html">Node</a></span>, node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : <a href="ContextNode.html">ContextNode</a></span> </h3>
<div class="method">
<div class="description">
<p>TSL function for defining a built-in ambient occlusion context for a given node.</p>
</div>
<table class="params">
<tbody>
<tr>
<td class="name">
<strong>aoNode</strong>
</td>
<td class="description last">
<p>The ambient occlusion value node to apply.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>node</strong>
</td>
<td class="description last">
<p>The node whose context should be modified.</p>
<p>Default is <code>null</code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h3 class="name name-method" id="builtinShadowContext" translate="no">.<a href="#builtinShadowContext">builtinShadowContext</a><span class="signature">( shadowNode : <span class="param-type"><a href="ShadowNode.html">ShadowNode</a></span>, light : <span class="param-type"><a href="Light.html">Light</a></span>, node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : <a href="ContextNode.html">ContextNode</a></span> </h3>
<div class="method">
<div class="description">
<p>TSL function for defining a built-in shadow context for a given node.</p>
</div>
<table class="params">
<tbody>
<tr>
<td class="name">
<strong>shadowNode</strong>
</td>
<td class="description last">
<p>The shadow node representing the light's shadow.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>light</strong>
</td>
<td class="description last">
<p>The light associated with the shadow.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>node</strong>
</td>
<td class="description last">
<p>The node whose context should be modified.</p>
<p>Default is <code>null</code>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h3 class="name name-method" id="bumpMap" translate="no">.<a href="#bumpMap">bumpMap</a><span class="signature">( textureNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, scaleNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span> )</span><span class="type-signature"> : <a href="BumpMapNode.html">BumpMapNode</a></span> </h3>
<div class="method">
<div class="description">
Expand Down Expand Up @@ -11724,6 +11786,46 @@ <h3 class="name name-method" id="viewportTexture" translate="no">.<a href="#view
</tbody>
</table>
</div>
<h3 class="name name-method" id="vogelDiskSample" translate="no">.<a href="#vogelDiskSample">vogelDiskSample</a><span class="signature">( sampleIndex : <span class="param-type"><a href="Node.html">Node</a>.&lt;int></span>, samplesCount : <span class="param-type"><a href="Node.html">Node</a>.&lt;int></span>, phi : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec2></span> </h3>
<div class="method">
<div class="description">
<p>Vogel disk sampling for uniform circular distribution.</p>
<p>This function generates sample points distributed uniformly on a disk using the golden angle,
resulting in an efficient low-discrepancy sequence for sampling. The rotation parameter (phi)
allows randomizing the pattern per-pixel when combined with IGN.</p>
</div>
<table class="params">
<tbody>
<tr>
<td class="name">
<strong>sampleIndex</strong>
</td>
<td class="description last">
<p>The index of the current sample (0-based).</p>
</td>
</tr>
<tr>
<td class="name">
<strong>samplesCount</strong>
</td>
<td class="description last">
<p>The total number of samples.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>phi</strong>
</td>
<td class="description last">
<p>Rotation angle in radians (typically from IGN * 2π).</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-returns"><strong>Returns:</strong> A 2D point on the unit disk.</dt>
</dl>
</div>
<h3 class="name name-method" id="wgsl" translate="no">.<a href="#wgsl">wgsl</a><span class="signature">( src : <span class="param-type">string</span>, includes : <span class="param-type">Array.&lt;<a href="Node.html">Node</a>></span> )</span><span class="type-signature"> : <a href="CodeNode.html">CodeNode</a></span> </h3>
<div class="method">
<div class="description">
Expand Down
64 changes: 63 additions & 1 deletion docs/pages/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,10 @@ <h3 class="name name-method" id="BasicShadowFilter" translate="no">.<a href="#Ba
<h3 class="name name-method" id="PCFShadowFilter" translate="no">.<a href="#PCFShadowFilter">PCFShadowFilter</a><span class="signature">( inputs : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
<div class="method">
<div class="description">
<p>A shadow filtering function performing PCF filtering.</p>
<p>A shadow filtering function performing PCF filtering with Vogel disk sampling and IGN.</p>
<p>Uses 5 samples distributed via Vogel disk pattern, rotated per-pixel using Interleaved
Gradient Noise (IGN) to break up banding artifacts. Combined with hardware PCF (4-tap
filtering per sample), this effectively provides 20 filtered taps with better distribution.</p>
</div>
<table class="params">
<tbody>
Expand Down Expand Up @@ -1732,6 +1735,65 @@ <h3 class="name name-method" id="PCFSoftShadowFilter" translate="no">.<a href="#
<dt class="tag-returns"><strong>Returns:</strong> The filtering result.</dt>
</dl>
</div>
<h3 class="name name-method" id="PointShadowFilter" translate="no">.<a href="#PointShadowFilter">PointShadowFilter</a><span class="signature">( inputs : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
<div class="method">
<div class="description">
<p>A shadow filtering function for point lights using Vogel disk sampling and IGN.</p>
<p>Uses 5 samples distributed via Vogel disk pattern in tangent space around the
sample direction, rotated per-pixel using Interleaved Gradient Noise (IGN).</p>
</div>
<table class="params">
<tbody>
<tr>
<td class="name">
<strong>inputs</strong>
</td>
<td class="description last">
<p>The input parameter object.</p>
<table class="params">
<tbody>
<tr>
<td class="name">
<strong>depthTexture</strong>
</td>
<td class="description last">
<p>A reference to the shadow cube map.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>bd3D</strong>
</td>
<td class="description last">
<p>The normalized direction from light to fragment.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>dp</strong>
</td>
<td class="description last">
<p>The depth value to compare against.</p>
</td>
</tr>
<tr>
<td class="name">
<strong>shadow</strong>
</td>
<td class="description last">
<p>The light shadow.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-returns"><strong>Returns:</strong> The filtering result.</dt>
</dl>
</div>
<h3 class="name name-method" id="Stack" translate="no">.<a href="#Stack">Stack</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
<div class="method">
<div class="description">
Expand Down
Loading
Loading