Skip to content

feat: replace shaders with TSL equivalent#2764

Draft
HoloTheDrunk wants to merge 3 commits into
iTowns:masterfrom
HoloTheDrunk:tsl-exploration
Draft

feat: replace shaders with TSL equivalent#2764
HoloTheDrunk wants to merge 3 commits into
iTowns:masterfrom
HoloTheDrunk:tsl-exploration

Conversation

@HoloTheDrunk

Copy link
Copy Markdown
Contributor

Warning

Early draft, missing a lot of implementation. This is exploratory work largely meant for discussion rather than direct inclusion into iTowns.

Description

Attempts to replace the different shaders used within iTowns with equivalent TSL variants to smoothen the addition of WebGPU support.

Motivation and Context

Maintaining two different versions of every shader in GLSL and WGSL would increase maintenance work to keep them coherent, not to mention the different features supported by WebGL and WebGPU. Having a single source of truth will help avoid this issue.
We also benefit from taking a good look at the shaders and what's really necessary, hopefully allowing us to make the shader code much simpler.

Note

It's important to keep in mind that TSL is still a nascent evolution of Three.js that will likely undergo significant changes over time, so its current shortcomings (like documentation and error reporting) will have been improved upon by the time we can fully transition to WebGPU being a primary target (if that day ever comes).

@HoloTheDrunk HoloTheDrunk self-assigned this May 6, 2026
@gchoqueux

Copy link
Copy Markdown
Contributor

@HoloTheDrunk #2612 simplifies LayeredMaterial and it refactors it while adhering as closely as possible to TSL standards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants