Skip to content

Commit

Permalink
WGSLNodeBuilder: Add greaterThan for vec3
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Dec 2, 2023
1 parent 51dcb5e commit f08d012
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const wgslMethods = {
dFdy: '- dpdy',
mod: 'threejs_mod',
lessThanEqual: 'threejs_lessThanEqual',
inversesqrt: 'inverseSqrt'
greaterThan: 'threejs_greaterThan',
inversesqrt: 'inverseSqrt',
bitcast: 'bitcast<f32>'
};

Expand All @@ -73,6 +74,13 @@ fn threejs_lessThanEqual( a : vec3<f32>, b : vec3<f32> ) -> vec3<bool> {
return vec3<bool>( a.x <= b.x, a.y <= b.y, a.z <= b.z );
}
` ),
greaterThan: new CodeNode( `
fn threejs_greaterThan( a : vec3<f32>, b : vec3<f32> ) -> vec3<bool> {
return vec3<bool>( a.x > b.x, a.y > b.y, a.z > b.z );
}
` ),
mod: new CodeNode( `
Expand Down

0 comments on commit f08d012

Please sign in to comment.