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
13 changes: 4 additions & 9 deletions examples/jsm/nodes/accessors/ModelViewProjectionNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@ import { nodeProxy } from '../shadernode/ShaderNode.js';

class ModelViewProjectionNode extends Node {

constructor( position = positionLocal ) {
constructor( positionNode = positionLocal ) {

super( 'vec4' );

this.position = position;
this.positionNode = positionNode;

}

generate( builder ) {
construct() {

const position = this.position;

const mvpMatrix = cameraProjectionMatrix.mul( modelViewMatrix );
const mvpNode = mvpMatrix.mul( position );

return mvpNode.build( builder );
return cameraProjectionMatrix.mul( modelViewMatrix ).mul( this.positionNode );

}

Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/nodes/accessors/SkinningNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ const Skinning = new ShaderNode( ( inputs, {}, builder ) => {
const skinVertex = bindMatrix.mul( positionLocal );

const skinned = add(
boneMatX.mul( skinVertex ).mul( weight.x ),
boneMatY.mul( skinVertex ).mul( weight.y ),
boneMatZ.mul( skinVertex ).mul( weight.z ),
boneMatW.mul( skinVertex ).mul( weight.w )
boneMatX.mul( weight.x ).mul( skinVertex ),
boneMatY.mul( weight.y ).mul( skinVertex ),
boneMatZ.mul( weight.z ).mul( skinVertex ),
boneMatW.mul( weight.w ).mul( skinVertex )
);

const skinPosition = bindMatrixInverse.mul( skinned ).xyz;
Expand Down