Customising Shaders
See original GitHub issueCurrently we can set material.vert and material.frag but that breaks as we also include them in the depth prepass shaders vert: material.vert || DEPTH_PASS_VERT. The correct (needs testing) way is to define all 3 shaders and use preprocessor to support all 3 cases
#ifdef DEPTH_PRE_PASS_ONLY
//copy pre pass shader
#elseif DEPTH_PASS_ONLY
//copy depth shader
#else
//pbr shader
#endif
That’s painful.
Related
- ThreeJS discussion about string replacement before compile https://github.com/mrdoob/three.js/issues/11475
- Use Shader Modifiers to Extend SceneKit Shading
Issue Analytics
- State:
- Created 4 years ago
- Comments:33 (26 by maintainers)
Top Results From Across the Web
Complementary Shaders v4 - Customization - CurseForge
Complementary Shaders v4 is a Minecraft Java Edition shader pack based on Capt Tatsu's "BSL Shaders". The goal of Complementary v4 is being...
Read more >Custom Shaders | Learn PlayCanvas
This tutorial uses a custom shader on a material to create a dissolve effect in GLSL. Complete project can be found here.
Read more >Custom shaders | Stride
You can write your own shaders in Visual Studio and use them in material attributes. For example, you can write a shader to...
Read more >Writing Custom Shaders For Toolbag - Marmoset
Learn how to create custom shaders for Toolbag 3. Replace shading models, add new effects and more!
Read more >Custom Shaders - LightAct
Custom shaders are loaded with a Custom Shader node. At its most basic configuration, it has just 2 inputs: Resolution and Filepath.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

TLDR: not aiming for fully dynamic gpu compute graphs, just avoiding yet-another-pbr-version-with-this-one-small-change
To answer concern about hooks
We could limit it to those touch points VERT_BEFORE_TRANSFORM //after reading from attributes like aNormal VERT_AFTER_TRANSFORM //after skinning skinning, moving to world space etc FRAG_BEFORE_TEXTURES //after reading from varyings and uniforms but before reading from textures FRAG_BEFORE_PBR //before doing lighting math FRAG_AFTER_PBR //after pbr math, allows for individual direct/indirect/emissive overwrites FRAG_END //before writing to screen
What would probably cover 90% of cases for me.
Just few. See above
No need. Entry points should be limited.
Not desired IMO. Any example use cases?
To be available only in standard PBR material.
I don’t understand the idea of compiling shader graphs on the web. It seems that three’s
NodeMaterialis struggling with just that. I really like the scene kit approach to this problem. I think that after you’ve made some graph, in some application, you should generate some GLSL, in three’s case something compatible with it (specific uniform/attribute names and such).Heh i also didn’t realize i wasn’t on three’s page anymore 😄