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
51 changes: 27 additions & 24 deletions build/three.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9094,7 +9094,8 @@ class RenderTarget extends EventDispatcher {
* @property {number} [samples=0] - The MSAA samples count.
* @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.
* @property {number} [depth=1] - The texture depth.
* @property {boolean} [multiview=false] - Whether this target is used for multiview rendering.
* @property {boolean} [multiview=false] - Whether this target is used for multiview rendering (WebGL OVR_multiview2 extension).
* @property {boolean} [useArrayDepthTexture=false] - Whether to create the depth texture as an array texture for per-layer depth testing. This is separate from multiview so layered render targets can use array depth without the multiview extension.
*/

/**
Expand All @@ -9120,7 +9121,8 @@ class RenderTarget extends EventDispatcher {
samples: 0,
count: 1,
depth: 1,
multiview: false
multiview: false,
useArrayDepthTexture: false
}, options );

/**
Expand Down Expand Up @@ -9257,6 +9259,16 @@ class RenderTarget extends EventDispatcher {
*/
this.multiview = options.multiview;

/**
* Whether to create the depth texture as an array texture for per-layer depth testing.
* This is separate from multiview so layered render targets can use array depth without
* the multiview extension.
*
* @type {boolean}
* @default false
*/
this.useArrayDepthTexture = options.useArrayDepthTexture;

}

_setTextureOptions( options = {} ) {
Expand Down Expand Up @@ -9428,6 +9440,7 @@ class RenderTarget extends EventDispatcher {

this.samples = source.samples;
this.multiview = source.multiview;
this.useArrayDepthTexture = source.useArrayDepthTexture;

return this;

Expand Down Expand Up @@ -18933,13 +18946,14 @@ class BufferGeometry extends EventDispatcher {
const normalAttribute = attributes.normal;
const uvAttribute = attributes.uv;

if ( this.hasAttribute( 'tangent' ) === false ) {
let tangentAttribute = this.getAttribute( 'tangent' );

this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
if ( tangentAttribute === undefined || tangentAttribute.count !== positionAttribute.count ) {

}
tangentAttribute = new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 );
this.setAttribute( 'tangent', tangentAttribute );

const tangentAttribute = this.getAttribute( 'tangent' );
}

const tan1 = [], tan2 = [];

Expand Down Expand Up @@ -19085,7 +19099,7 @@ class BufferGeometry extends EventDispatcher {

let normalAttribute = this.getAttribute( 'normal' );

if ( normalAttribute === undefined ) {
if ( normalAttribute === undefined || normalAttribute.count !== positionAttribute.count ) {

normalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );
this.setAttribute( 'normal', normalAttribute );
Expand Down Expand Up @@ -41737,9 +41751,8 @@ class DiscreteInterpolant extends Interpolant {
* each keyframe has explicit in/out tangent control points specified as
* 2D coordinates (time, value).
*
* The tangent data must be provided via the `settings` object:
* - `settings.inTangents`: Float32Array with [time, value] pairs per keyframe per component
* - `settings.outTangents`: Float32Array with [time, value] pairs per keyframe per component
* Tangent data is read from `inTangents` and `outTangents` on the interpolant
* (populated by `KeyframeTrack.InterpolantFactoryMethodBezier`).
*
* For a track with N keyframes and stride S:
* - Each tangent array has N * S * 2 values
Expand All @@ -41759,9 +41772,8 @@ class BezierInterpolant extends Interpolant {
const offset1 = i1 * stride;
const offset0 = offset1 - stride;

const settings = this.settings || this.DefaultSettings_;
const inTangents = settings.inTangents;
const outTangents = settings.outTangents;
const inTangents = this.inTangents;
const outTangents = this.outTangents;

// If no tangent data, fall back to linear interpolation
if ( ! inTangents || ! outTangents ) {
Expand Down Expand Up @@ -41982,10 +41994,10 @@ class KeyframeTrack {

const interpolant = new BezierInterpolant( this.times, this.values, this.getValueSize(), result );

// Pass tangent data from track settings to interpolant
if ( this.settings ) {

interpolant.settings = this.settings;
interpolant.inTangents = this.settings.inTangents;
interpolant.outTangents = this.settings.outTangents;

}

Expand Down Expand Up @@ -53281,15 +53293,6 @@ class AnimationAction {

const interpolant = tracks[ i ].createInterpolant( null );
interpolants[ i ] = interpolant;

// preserve interpolant settings (like tangent data from BezierInterpolant)

if ( interpolant.settings ) {

Object.assign( interpolantSettings, interpolant.settings );

}

interpolant.settings = interpolantSettings;

}
Expand Down
51 changes: 27 additions & 24 deletions build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -9114,7 +9114,8 @@ class RenderTarget extends EventDispatcher {
* @property {number} [samples=0] - The MSAA samples count.
* @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.
* @property {number} [depth=1] - The texture depth.
* @property {boolean} [multiview=false] - Whether this target is used for multiview rendering.
* @property {boolean} [multiview=false] - Whether this target is used for multiview rendering (WebGL OVR_multiview2 extension).
* @property {boolean} [useArrayDepthTexture=false] - Whether to create the depth texture as an array texture for per-layer depth testing. This is separate from multiview so layered render targets can use array depth without the multiview extension.
*/

/**
Expand All @@ -9140,7 +9141,8 @@ class RenderTarget extends EventDispatcher {
samples: 0,
count: 1,
depth: 1,
multiview: false
multiview: false,
useArrayDepthTexture: false
}, options );

/**
Expand Down Expand Up @@ -9277,6 +9279,16 @@ class RenderTarget extends EventDispatcher {
*/
this.multiview = options.multiview;

/**
* Whether to create the depth texture as an array texture for per-layer depth testing.
* This is separate from multiview so layered render targets can use array depth without
* the multiview extension.
*
* @type {boolean}
* @default false
*/
this.useArrayDepthTexture = options.useArrayDepthTexture;

}

_setTextureOptions( options = {} ) {
Expand Down Expand Up @@ -9448,6 +9460,7 @@ class RenderTarget extends EventDispatcher {

this.samples = source.samples;
this.multiview = source.multiview;
this.useArrayDepthTexture = source.useArrayDepthTexture;

return this;

Expand Down Expand Up @@ -18953,13 +18966,14 @@ class BufferGeometry extends EventDispatcher {
const normalAttribute = attributes.normal;
const uvAttribute = attributes.uv;

if ( this.hasAttribute( 'tangent' ) === false ) {
let tangentAttribute = this.getAttribute( 'tangent' );

this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
if ( tangentAttribute === undefined || tangentAttribute.count !== positionAttribute.count ) {

}
tangentAttribute = new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 );
this.setAttribute( 'tangent', tangentAttribute );

const tangentAttribute = this.getAttribute( 'tangent' );
}

const tan1 = [], tan2 = [];

Expand Down Expand Up @@ -19105,7 +19119,7 @@ class BufferGeometry extends EventDispatcher {

let normalAttribute = this.getAttribute( 'normal' );

if ( normalAttribute === undefined ) {
if ( normalAttribute === undefined || normalAttribute.count !== positionAttribute.count ) {

normalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );
this.setAttribute( 'normal', normalAttribute );
Expand Down Expand Up @@ -41757,9 +41771,8 @@ class DiscreteInterpolant extends Interpolant {
* each keyframe has explicit in/out tangent control points specified as
* 2D coordinates (time, value).
*
* The tangent data must be provided via the `settings` object:
* - `settings.inTangents`: Float32Array with [time, value] pairs per keyframe per component
* - `settings.outTangents`: Float32Array with [time, value] pairs per keyframe per component
* Tangent data is read from `inTangents` and `outTangents` on the interpolant
* (populated by `KeyframeTrack.InterpolantFactoryMethodBezier`).
*
* For a track with N keyframes and stride S:
* - Each tangent array has N * S * 2 values
Expand All @@ -41779,9 +41792,8 @@ class BezierInterpolant extends Interpolant {
const offset1 = i1 * stride;
const offset0 = offset1 - stride;

const settings = this.settings || this.DefaultSettings_;
const inTangents = settings.inTangents;
const outTangents = settings.outTangents;
const inTangents = this.inTangents;
const outTangents = this.outTangents;

// If no tangent data, fall back to linear interpolation
if ( ! inTangents || ! outTangents ) {
Expand Down Expand Up @@ -42002,10 +42014,10 @@ class KeyframeTrack {

const interpolant = new BezierInterpolant( this.times, this.values, this.getValueSize(), result );

// Pass tangent data from track settings to interpolant
if ( this.settings ) {

interpolant.settings = this.settings;
interpolant.inTangents = this.settings.inTangents;
interpolant.outTangents = this.settings.outTangents;

}

Expand Down Expand Up @@ -53301,15 +53313,6 @@ class AnimationAction {

const interpolant = tracks[ i ].createInterpolant( null );
interpolants[ i ] = interpolant;

// preserve interpolant settings (like tangent data from BezierInterpolant)

if ( interpolant.settings ) {

Object.assign( interpolantSettings, interpolant.settings );

}

interpolant.settings = interpolantSettings;

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

Large diffs are not rendered by default.

Loading
Loading