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

Basic TSL Examples / snippets focusing on Individual Features #30134

Open
Samsy opened this issue Dec 16, 2024 · 2 comments
Open

Basic TSL Examples / snippets focusing on Individual Features #30134

Samsy opened this issue Dec 16, 2024 · 2 comments
Labels
Documentation TSL Three.js Shading Language

Comments

@Samsy
Copy link
Contributor

Samsy commented Dec 16, 2024

Description

First, I want to express gratitude for the incredible work on Three.js and the new TSL architecture. As a long-time Three.js user since 2012, I'm excited about WebGPU and TSL, but I'm having hard time to make the transition from Legacy to TSL.

The current TSL examples showcase the graphical capabilities of the engine with WebGPU. However, it can be challenging to isolate the fundamental TSL concepts from the broader engine demonstrations.

While the existing examples effectively demonstrate what TSL can achieve, they often combine multiple concepts together. This makes it confusing to understand the basic building blocks of TSL first, before applying them to more complex graphics scenarios.

In my experience with the transition, some aspects of TSL are quite intuitive and even simplify certain tasks compared to the legacy approach. However, other basic operations remain mysterious and hard to grasp, especially when trying to port legacy advanced materials to the new system.

For instance, developers who are starting from scratch with TSL would benefit from examples / snippets of isolated operations like :

  • the multiple ways to sample a texture ( inline, within fn, using texture( tex, uv ), texture(tex).sample( xx )
  • how to discard, and the multiple ways to discard a fragment shader
  • an isolated example of xxx node
  • using setLayout and arguments types
  • adding a label to a variable
  • how to extend a built-in normal using materialNormal etc..
  • how to write "defines" in TSL ( property )
  • using a materialReference etc..

I'm unsure if other developers are experiencing similar difficulties, but I believe having simpler snippets that demonstrate each TSL concept, operation, aspect, and node in isolation using both inline and Fn, would be incredibly valuable for the community's transition to the new system.

@Makio64
Copy link
Contributor

Makio64 commented Dec 16, 2024

I mention it in another issue but an example ultra minimalist by nodes would be awesome, example: https://animejs.com/documentation/

@sunag sunag added Documentation TSL Three.js Shading Language labels Dec 16, 2024
@Mugen87
Copy link
Collaborator

Mugen87 commented Dec 16, 2024

To me, what you are basically requesting are extensions to our current guide and manual sections. Such guides could introduce into TSL and showcase all the points you have listed.

Would you mind if merge this discussion into #29829?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation TSL Three.js Shading Language
Projects
None yet
Development

No branches or pull requests

4 participants