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
1 change: 0 additions & 1 deletion src/nodes/Nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export { default as PointUVNode } from './accessors/PointUVNode.js';
export { default as ReferenceBaseNode } from './accessors/ReferenceBaseNode.js';
export { default as ReferenceNode } from './accessors/ReferenceNode.js';
export { default as RendererReferenceNode } from './accessors/RendererReferenceNode.js';
export { default as SceneNode } from './accessors/SceneNode.js';
export { default as SkinningNode } from './accessors/SkinningNode.js';
export { default as StorageBufferNode } from './accessors/StorageBufferNode.js';
export { default as StorageTextureNode } from './accessors/StorageTextureNode.js';
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/TSL.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export * from './accessors/Position.js';
export * from './accessors/ReferenceNode.js';
export * from './accessors/ReflectVector.js';
export * from './accessors/SkinningNode.js';
export * from './accessors/SceneNode.js';
export * from './accessors/SceneProperties.js';
export * from './accessors/StorageBufferNode.js';
export * from './accessors/Tangent.js';
export * from './accessors/TextureNode.js';
Expand Down
145 changes: 0 additions & 145 deletions src/nodes/accessors/SceneNode.js

This file was deleted.

53 changes: 53 additions & 0 deletions src/nodes/accessors/SceneProperties.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { UVMapping } from '../../constants.js';
import { Euler } from '../../math/Euler.js';
import { Matrix4 } from '../../math/Matrix4.js';
import { renderGroup } from '../core/UniformGroupNode.js';
import { uniform } from '../tsl/TSLBase.js';

const _e1 = /*@__PURE__*/ new Euler();
const _m1 = /*@__PURE__*/ new Matrix4();

/**
* TSL object that represents the scene's background blurriness.
*
* @tsl
* @type {Node<float>}
*/
export const backgroundBlurriness = /*@__PURE__*/ uniform( 0 ).setGroup( renderGroup ).onRenderUpdate( ( { scene } ) => scene.backgroundBlurriness );

/**
* TSL object that represents the scene's background intensity.
*
* @tsl
* @type {Node<float>}
*/
export const backgroundIntensity = /*@__PURE__*/ uniform( 1 ).setGroup( renderGroup ).onRenderUpdate( ( { scene } ) => scene.backgroundIntensity );

/**
* TSL object that represents the scene's background rotation.
*
* @tsl
* @type {Node<mat4>}
*/
export const backgroundRotation = /*@__PURE__*/ uniform( new Matrix4() ).setGroup( renderGroup ).onRenderUpdate( ( { scene } ) => {

const background = scene.background;

if ( background !== null && background.isTexture && background.mapping !== UVMapping ) {

_e1.copy( scene.backgroundRotation );

// accommodate left-handed frame
_e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;

_m1.makeRotationFromEuler( _e1 );

} else {

_m1.identity();

}

return _m1;

} );