Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glsl => tsl transpiler bugs #29928

Open
Makio64 opened this issue Nov 20, 2024 · 1 comment
Open

glsl => tsl transpiler bugs #29928

Makio64 opened this issue Nov 20, 2024 · 1 comment
Assignees
Labels
TSL Three.js Shading Language

Comments

@Makio64
Copy link
Contributor

Makio64 commented Nov 20, 2024

Description

Using https://threejs.org/examples/webgpu_tsl_transpiler.html to convert some of my previous shader i got into various bugs ;

  • invertsqrt not add to the import list ( and also it should be convert to invertSqrt camel case in tsl )
  • float x = .5 * .5; => const x = float( .5.mul( .5 ) ).toVar(); .5 will not be recognize as it should be float(.5)
  • vec2 x = .5 * vec2(.5); => const x = vec2( .5.mul( vec2( .5 ) ) ).toVar(); similar bug
  • vec4 a1 = (floor(0.)).xzyw; => const a1 = vec4( floor( 0. )..( xzyw ) ).toVar(); this is incorrect, it should eb ..( xzyw) => .xzyw

Reproduction steps

  1. copy the incorrect code in https://threejs.org/examples/webgpu_tsl_transpiler.html

Code

glsl code in description

Live example

https://threejs.org/examples/webgpu_tsl_transpiler.html

Screenshots

No response

Version

r170

Device

No response

Browser

No response

OS

No response

@Makio64
Copy link
Contributor Author

Makio64 commented Nov 20, 2024

Side note : I coudnt convert correctly : https://www.shadertoy.com/view/Xd3GRf
Here my attempt but after correcting the obvious bug in the synthax something still not working : https://jsfiddle.net/f6k9nLot/3/ ( probably the last line in the shader )

@mrdoob mrdoob added the TSL Three.js Shading Language label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TSL Three.js Shading Language
Projects
None yet
Development

No branches or pull requests

3 participants