Skip to content

Commit

Permalink
use new tsl
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed May 20, 2024
1 parent 39f5dd5 commit ef4c738
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions examples/jsm/nodes/materials/VolumeNodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
import { varying } from '../core/VaryingNode.js';
import { property } from '../core/PropertyNode.js';
import { materialReference } from '../accessors/MaterialReferenceNode.js';
import { modelWorldMatrixInverse } from '../accessors/ModelNode.js';
import { cameraPosition } from '../accessors/CameraNode.js';
import { reference } from '../accessors/ReferenceNode.js';
import { positionGeometry } from '../accessors/PositionNode.js';
import { tslFn, vec2, vec3, vec4 } from '../shadernode/ShaderNode.js';
import { min, max } from '../math/MathNode.js';
Expand Down Expand Up @@ -51,7 +51,6 @@ class VolumeNodeMaterial extends NodeMaterial {

this.fragmentNode = tslFn( () => {

const modelWorldMatrixInverse = reference( 'matrixWorldInverse', 'mat4' );
const vOrigin = varying( vec3( modelWorldMatrixInverse.mul( vec4( cameraPosition, 1.0 ) ) ) );
const vDirection = varying( positionGeometry.sub( vOrigin ) );

Expand Down
3 changes: 0 additions & 3 deletions examples/webgpu_volume_cloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
} );

mesh = new THREE.Mesh( geometry, material );
mesh.matrixWorldInverse = mesh.matrixWorld.clone().invert();

scene.add( mesh );

Expand Down Expand Up @@ -193,8 +192,6 @@
function animate() {

mesh.rotation.y = - performance.now() / 7500;
mesh.matrixWorldInverse.copy( mesh.matrixWorld ).invert();


renderer.render( scene, camera );

Expand Down
4 changes: 1 addition & 3 deletions examples/webgpu_volume_perlin.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
} );

mesh = new THREE.Mesh( geometry, material );
mesh.matrixWorldInverse = mesh.matrixWorld.clone().invert();

scene.add( mesh );

//
Expand Down Expand Up @@ -149,8 +149,6 @@

function animate() {

mesh.matrixWorldInverse.copy( mesh.matrixWorld ).invert();

renderer.render( scene, camera );

}
Expand Down

0 comments on commit ef4c738

Please sign in to comment.