Sign In

three

Package Overview
Dependencies
Maintainers
2
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three - npm Package Compare versions

Comparing version
0.185.0
to
0.185.1
+2
-2
package.json
{
"name": "three",
"version": "0.185.0",
"version": "0.185.1",
"description": "JavaScript 3D library",

@@ -23,3 +23,3 @@ "type": "module",

"type": "git",
"url": "git+https://github.com/mrdoob/three.js.git"
"url": "https://github.com/mrdoob/three.js"
},

@@ -26,0 +26,0 @@ "sideEffects": [

@@ -288,3 +288,4 @@ import { Color } from '../../math/Color.js';

const candidate = entries[ j ];
if ( ! candidate.boundingBox.containsPoint( entry.interiorPoint ) ) continue;
if ( ! candidate.boundingBox.containsBox( entry.boundingBox ) ) continue;
if ( ! pointInPolygon( entry.interiorPoint, candidate.points ) ) continue;

@@ -291,0 +292,0 @@

@@ -26,8 +26,8 @@

* @param {InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceMatrix - The matrix buffer attribute.
* @param {number} count - The instance count.
* @returns {Node} The matrix node.
*/
function createInstanceMatrixNode( builder, instanceMatrix, count ) {
function createInstanceMatrixNode( builder, instanceMatrix ) {
let instanceMatrixNode;
const matrixCount = Math.max( instanceMatrix.count, 1 );

@@ -38,11 +38,11 @@ const isStorageMatrix = instanceMatrix.isStorageInstancedBufferAttribute === true;

instanceMatrixNode = storage( instanceMatrix, 'mat4', Math.max( count, 1 ) ).element( instanceIndex );
instanceMatrixNode = storage( instanceMatrix, 'mat4', matrixCount ).element( instanceIndex );
} else {
const uniformBufferSize = count * 16 * 4;
const uniformBufferSize = matrixCount * 16 * 4;
if ( uniformBufferSize <= builder.getUniformBufferLimit() ) {
instanceMatrixNode = buffer( instanceMatrix.array, 'mat4', Math.max( count, 1 ) ).element( instanceIndex );
instanceMatrixNode = buffer( instanceMatrix.array, 'mat4', matrixCount ).element( instanceIndex );

@@ -86,6 +86,5 @@ } else {

* @param {NodeBuilder} builder - The current node builder.
* @param {number} count - The instance count.
* @returns {Node} The previous frame instance matrix node.
*/
function getPreviousInstance( instancedMesh, instanceMatrix, builder, count ) {
function getPreviousInstance( instancedMesh, instanceMatrix, builder ) {

@@ -100,3 +99,3 @@ let data = _previousInstanceMatrices.get( instancedMesh );

previousInstanceMatrix,
node: createInstanceMatrixNode( builder, previousInstanceMatrix, count )
node: createInstanceMatrixNode( builder, previousInstanceMatrix )
};

@@ -125,15 +124,11 @@

* @function
* @param {number} count - The instance count.
* @param {InstancedBufferAttribute|StorageInstancedBufferAttribute} matrices - The instanced transformation matrices.
* @param {?InstancedBufferAttribute|StorageInstancedBufferAttribute} [colors=null] - The optional instanced colors.
*/
export const instance = /*@__PURE__*/ Fn( ( [ count, matrices, colors = null ], builder ) => {
export const instance = /*@__PURE__*/ Fn( ( [ matrices, colors = null ], builder ) => {
// get numeric value (non-node)
count = count.value;
const isStorageMatrix = matrices.isStorageInstancedBufferAttribute === true;
const isStorageColor = colors && colors.isStorageInstancedBufferAttribute === true;
const instanceMatrixNode = createInstanceMatrixNode( builder, matrices, count );
const instanceMatrixNode = createInstanceMatrixNode( builder, matrices );

@@ -145,3 +140,3 @@ // interleaved buffer tracking for matrix

const uniformBufferSize = count * 16 * 4;
const uniformBufferSize = Math.max( matrices.count, 1 ) * 16 * 4;

@@ -238,3 +233,3 @@ if ( uniformBufferSize > builder.getUniformBufferLimit() ) {

const previousInstanceMatrixNode = getPreviousInstance( instancedMesh, matrices, builder, count );
const previousInstanceMatrixNode = getPreviousInstance( instancedMesh, matrices, builder );
positionPrevious.assign( previousInstanceMatrixNode.mul( positionPrevious ).xyz );

@@ -272,8 +267,6 @@

const { count, instanceMatrix, instanceColor } = instancedMesh;
const { instanceMatrix, instanceColor } = instancedMesh;
instance( count, instanceMatrix, instanceColor );
instance( instanceMatrix, instanceColor );
}, 'void' );

@@ -29,4 +29,4 @@ import { Matrix4 } from '../../math/Matrix4.js';

* TSL object that represents the rotation of environment maps.
* When `material.envMap` is set, the value is `material.envMapRotation`. `scene.environmentRotation` controls the
* rotation of `scene.environment` instead.
* When `material.envMap` is set, the value is `material.envMapRotation`.
* `scene.environmentRotation` controls the rotation of `scene.environment` or `scene.environmentNode` instead.
*

@@ -42,3 +42,4 @@ * @tsl

const rotation = ( scene.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;
const hasSceneEnvironment = ( scene.environment !== null ) || ( scene.environmentNode && scene.environmentNode.isNode );
const rotation = ( hasSceneEnvironment && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;

@@ -45,0 +46,0 @@ if ( rotation ) {

@@ -34,3 +34,3 @@ import { UVMapping } from '../../constants.js';

if ( background !== null && background.isTexture && background.mapping !== UVMapping ) {
if ( ( background !== null && background.isTexture && background.mapping !== UVMapping ) || ( scene.backgroundNode && scene.backgroundNode.isNode ) ) {

@@ -37,0 +37,0 @@ // note: since the matrix is orthonormal, we can use the more-efficient transpose() in lieu of invert()

@@ -173,2 +173,6 @@ import OutputStructNode from './OutputStructNode.js';

const index = getTextureIndex( textures, name );
// Ignore if the output exists in the MRT but has never been used.
if ( index === - 1 ) continue;
const type = builder.getOutputType( index );

@@ -175,0 +179,0 @@

@@ -175,5 +175,5 @@ import LightingModel from '../core/LightingModel.js';

// Ignore lights with infinite distance
// Ignore non-analytical lights and lights with infinite distance
if ( lightNode.light.distance === undefined ) return;
if ( lightNode.isAnalyticLightNode !== true || lightNode.light.distance === undefined ) return;

@@ -180,0 +180,0 @@ // TODO: We need a viewportOpaque*() ( output, depth ) to fit with modern rendering approaches

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display