Description
When using the transformDirection operation I believe the inner operation is incorrect.
The generated wgsl code is -
normalize( ( direction * matrix ).xyz )
When it shall be -
normalize( ( matrix * direction ).xyz )
Function signature -
transformDirection( direction : Node.<(vec2|vec3|vec4)>, matrix : Node.<(mat2|mat3|mat4)> ) : Node
Reproduction steps
- Create a node material
- Use transformDirection node
- Display generated wgsl
Code
if ( method === MathNode.TRANSFORM_DIRECTION ) {
// dir can be either a direction vector or a normal vector
// upper-left 3x3 of matrix is assumed to be orthogonal
let tA = aNode;
let tB = bNode;
if ( builder.isMatrix( tA.getNodeType( builder ) ) ) {
tB = vec4( vec3( tB ), 0.0 );
} else {
tA = vec4( vec3( tA ), 0.0 );
}
const mulNode = mul( tA, tB ).xyz; // shall be const mulNode = mul( tB, tA ).xyz;
outputNode = normalize( mulNode );
}
Live example
Self explanatory
Screenshots
No response
Version
r183
Device
No response
Browser
No response
OS
No response
Description
When using the
transformDirectionoperation I believe the inner operation is incorrect.The generated wgsl code is -
When it shall be -
Function signature -
Reproduction steps
Code
Live example
Self explanatory
Screenshots
No response
Version
r183
Device
No response
Browser
No response
OS
No response