You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shader chunks - is a very powerful feature of the engine, which allows to extend material capabilities.
Would be amazing to have a workflow of working with material's shader chunks from UI.
Just a section like for material slots (after Lightmap, before Other), with ability to add as many chunks as needed, specifying chunk name and shader asset. Very similar to the way Sound Slots are added.
Slot has name (chunk name), and enabled toggle.
For now GLSL only. In the future add a checkbox, by enabling which it will also add a WGSL shader asset slot, that way you can specify WGSL chunk variation, which will be used if WebGPU is active. Both asset slots are optional, by not having necessary asset, it will simply ignore the slot.
Engine would need to support this, with async loading in mind.
Adding/removing/enabling/disabling shader chunks, should be applied in real-time accordingly.
If shader asset content is updated, it should update materials accordingly, so editing shaders and seeing result - would be seamless (no refreshes needed).
For best UX, error reporting on shaders is in a good place atm, but it should support that if shader failed to compile, it would not break rendering, but ignore the shader (use default material?), and if chunk is updated again, it would try to re-compile again, so it is recoverable from broken state and would not require a page refresh.
Editor UI can help to mark materials accordingly if shader did not compile well. And on selecting material asset, it would mark a troubling chunk.
Important to not brick viewport rendering.
The text was updated successfully, but these errors were encountered:
Maksims
changed the title
Material Chunks
Material Shader Chunks Workflow
Feb 12, 2025
That's a great idea actually, it will make shader development easier.
Just a note, if actual shader assets are to be used (which makes sense authoring wise), we would need a system to concatenate them since they add http requests. For the moment we avoid that asset type, and add the shader code in .js files instead so we get that for free when building.
Just a note, if actual shader assets are to be used (which makes sense authoring wise), we would need a system to concatenate them since they add http requests. For the moment we avoid that asset type, and add the shader code in .js files instead so we get that for free when building.
Absolutely, we've used Bundles, they are ideal for that task: #1059
Shader chunks - is a very powerful feature of the engine, which allows to extend material capabilities.
Would be amazing to have a workflow of working with material's shader chunks from UI.
Just a section like for material slots (after Lightmap, before Other), with ability to add as many chunks as needed, specifying chunk name and shader asset. Very similar to the way Sound Slots are added.
Slot has name (chunk name), and enabled toggle.
For now GLSL only. In the future add a checkbox, by enabling which it will also add a WGSL shader asset slot, that way you can specify WGSL chunk variation, which will be used if WebGPU is active. Both asset slots are optional, by not having necessary asset, it will simply ignore the slot.
In material data, it will look like this:
Engine would need to support this, with async loading in mind.
Adding/removing/enabling/disabling shader chunks, should be applied in real-time accordingly.
If shader asset content is updated, it should update materials accordingly, so editing shaders and seeing result - would be seamless (no refreshes needed).
For best UX, error reporting on shaders is in a good place atm, but it should support that if shader failed to compile, it would not break rendering, but ignore the shader (use default material?), and if chunk is updated again, it would try to re-compile again, so it is recoverable from broken state and would not require a page refresh.
Editor UI can help to mark materials accordingly if shader did not compile well. And on selecting material asset, it would mark a troubling chunk.
Important to not brick viewport rendering.
The text was updated successfully, but these errors were encountered: