-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Labels
TSLThree.js Shading LanguageThree.js Shading Language
Milestone
Description
Description
This GLSL function...
vec3 hash34(vec4 src) {
uvec3 h = murmurHash34(floatBitsToUint(src));
vec3 v = uintBitsToFloat(h & 0x007fffffu | 0x3f800000u) - 1.0;
return v * 2.0 - 1.0;
}Is returning this TSL
export const hash34 = /*@__PURE__*/ Fn( ( [ src ] ) => {
const h = murmurHash34( floatBitsToUint( src ) );
const v = uintBitsToFloat( h.bitAnd( 0x007fffff ).bitOr( 0x3f800000 ) ).sub( 1.0 );
return v.mul( 2.0 ).sub( 1.0 );
}, { src: 'vec4', return: 'vec3' } );Functions using their shader language's equivalents of bitcast functionality should probably be recognized and return as TSL bitcast functions.
Reproduction steps
Copy the provided GLSL code into the TSL Transpiler example on Threejs.org
Code
N/A
Live example
N/A
Screenshots
No response
Version
r179
Device
Desktop
Browser
Chrome
OS
Windows
Metadata
Metadata
Assignees
Labels
TSLThree.js Shading LanguageThree.js Shading Language