You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
Samsy
changed the title
TSL conversion not working
TSL conversion not working / passing a varying as argument trouble / sampler2D conversion trouble
May 13, 2025
Description
Hello there,
I've been trying to convert a glsl into TSL using the transpiler https://threejs.org/examples/webgpu_tsl_transpiler :
Original :
Converted :
A few problem here it seems :
const m = sampler2D( m_immutable ).toVar();
seem incorrect, sampler2D may not existI removed the setLayout and got instead :
Then got another problem here, the compiler keep saying that mul on "n" is undefined
const x = float( n.mul( sin( mul( 0.3, time ).add( q.y.mul( 21.0 ) ) ) ).mul( sin( mul( 0.7, time ).add( q.y.mul( 29.0 ) ) ) ).mul( sin( add( 0.3, mul( 0.33, time ) ).add( q.y.mul( 31.0 ) ) ) ).mul( 0.0017 ) ).toVar();
"n" being the argument of the function coming from a varying :
n_immutable => varying float varying float nShiftPower;
const n = float( n_immutable ).toVar();
Reproduction steps
.
Code
.
Live example
.
Screenshots
No response
Version
last
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: