-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
TSL Roadmap #30849
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
Comments
In my opinion the biggest boost in spreading TSL would come if there is a documentation that is more friendly towards people who are new to TSL. Maybe the current TSL docs should be split in two - one more tutorial-oriened (with concepts, simple examples, and friendly explanations), and another more like a reference (with api, low-level details, etc). The first will attract users, the second will keep them engaged. Writing documentation is cumbersome, and I would like to give a helping hand in writing parts of the tutorial-oriented documentation and its examples. My biggest concern is that I barely know 10% of TSL and my time is somewhat limited. Most of these 10% come from trial-and-error. For example, today I used |
I agree with @boytchev's comments above. Adding a tutorialkit tutorial to my demo docs would be a good fit. To note, the current documentation issue #24984 would likely need to be resolved. |
There are jsdocs ready to be published. We mostly need to add some js code to the current docs to redirect the current links and avoid breaking all the doc links out there. |
I have some loose ambition to ensure As a developer of custom-shader stuff I'd love if I could easily make new materials that behaved like vanilla-materials in that GPU-uniforms can be accessed via arbitrary top-level properties. It was something I never saw anybody do in GLSL and I think it hurt the adoption of a cool custom-material ecosystem. There's probably a real opportunity to create this generalized system in TSL. I discussed the bundling/exporting of custom-shader-materials with @AndrewRayCode. He'd have better insight on the exact friction but from what I recall there was black-magic in material re-compilation triggers that was not-exposed and/or difficult to access |
Congrats on all the job on it @sunag , so many improvement in TSL since i start using it ! Big Thanks! **Tutorials **
Complex Shader
TSL TextureNode
NodeMaterial
Again congrats & thanks for your fast support ! |
@Bug-Reaper I'm less familiar with TSL overall so I might not be adding the right context. In the issue you linked - it takes a different approach than TSL. It uses a GLSL compiler to manipulate GLSL directly, making the shader node GLSL the source of truth for the inputs/outputs to the nodes. It finds uniforms/varyings/attributes by parsing the source code, and turns those into node inputs automatically. The end result relies on using onBeforeCompile (which I think is now deprecated / removed?) to fully hijack the Three.js material GLSL and basically overwrite what Three.js creates with the compiled Shaderfrog output. This allows some powerful composition techniques, for example a three.js material itself can be used as an input to another node, like this mixing a MeshPhysicalMaterial with a procedural fireball effect, which I don't think TSL currently supports. Maybe what you're referring to is - Shaderfrog can overwrite any arbitrary part of a Three.js shader / GLSL. I think Three.js treats some uniforms as "private" - you aren't meant to set them directly - rather you are meant to go through the material properties. In Shaderfrog the whole shader source code is fair game. If TSL can analyze source with a parser/compiler then in theory it could also search for, and expose, uniforms/attributes/varyings as first class citizens to replace? You might be generally talking about the challenges of using a DSL over a language (TSL over GLSL/WGSL). Shaderfrog has the "benefit" of users writing raw GLSL - maybe one option is to have a a raw code node in TSL so users could inject arbitrary code if the TSL abstraction doesn't support it as a first class fn? |
Learn from past experiencesThanks so much for your insights @AndrewRayCode. I see TSL in an embryonic stage I felt it was apt to call upon you as a person who has:
TSL does allow for some interesting gymnastics, I know I've played with an QuestionI guess my question to you is beyond routing and Honestly I'm trying to scout for decisions that cascade into longterm headaches or poor final developer experience. |
In my experience, the transpiler created some very verbose looking code but it was fine. It should be mentioned prominently in the docs (I spent a week manually transpiling 😂). Even better if I had something that could transpile an entire
I agree the current setup is confusing and am generally more favorable to merge
Not sure I fully understand this one but I do vibe hard with desire for an ecosystem of custom materials with the power of ancestor |
an option for the |
@boytchev @DefinitelyMaybe Thanks, the documentation and tutorials will definitely be one of the milestones. @Makio64 Thanks, there are a lot of interesting suggestions, I added the uniformTexture() alias to the roadmap. @Bug-Reaper We actually have more shared properties than before, like a simple normalWorld or TBN, previously you could see this rewritten in several custom shaders, attributes and uniforms are also there, you won't have problems with duplicated attributes or textures like you would in ShaderMaterial if you use attribute() or texture() methods. These new approaches are more self-intuitive for those who have used ShaderGraph, I think to answer your question it would be better if I made a migration guide, because it doesn't seem to be an issue or limitation, but documentation-wise, I just added a migration guide to the roadmap. Any new suggestions are welcome. |
@sunag Glad to hear 🙂 and yea I agree the new TSL system already resolves many of the traditional issues we saw with shader-materials. To that end, massively appreciate all your good work. I have to do a bunch of migration (~50 scenes or so) can try to contribute to the migration guide you mention. |
Thanks for everything @sunag , a bit late to the party of this thread, but as @Makio64 said precedently, I find myself often struggling with the UV's in the context of atlasing, a UVNode would be amazing to re-write the UV's in order to atlas a material map without over-riding the original behavior of the material |
Uh oh!
There was an error while loading. Please reload this page.
Description
Roadmap for TSL (Three.js Shading Language)
Overview
This issue tracks planned improvements and changes. The goal is to enhance usability, performance, and maintainability while also laying the groundwork for future tutorials and courses.
https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language
Would love to hear thoughts and suggestions! 🚀
Tasks
vec*
checks and warnings #30811, TSL: Improve warnings #30783append()
TSL: AddStack()
and.toStack()
#30956material.shadowPositionNode
tomaterial.receivedShadowPositionNode
Examples: Addwebgpu_caustics
and shadow revisions #30962uniformTexture()
TSL: IntroduceuniformTexture()
anduniformCubeTexture()
#31190texture.value
, but we consider having an alias to make its use more explicit.transformed
prefix TSL: Removetransformed*
prefix - WIP #31177transformed
prefix fromtransformedNormalView
,transformedNormalWorld
, and similar variables to improve readability and ease of use..assign()
behaviorLegacyShaderMaterial
*ShaderMaterial
toTSL
andNodeMaterial
Proxy
withprototype
Proxy
for better performance.The text was updated successfully, but these errors were encountered: