Inject code into shader code dynamically #9985
Unanswered
TomjWolcott
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm crossposting my post here from the discord. I was wondering how to edit the shader.wgsl as a string after it has loaded so I could dynamically add/switch out implementations of this wgsl function:
I was able to do this easily when using winit and wgpu by just editing shader.wgsl as a string:
but since bevy loads the shader through the asset server as
Handle<Shader>
and since theShader
struct doesn't seem to contain the contents of the wgsl file as a string, I'm not sure inject the various implementations. Btw, the bevy code I'm using right now is just the post processing example: https://bevyengine.org/examples/Shaders/post-processing/. Also I'm using bevy 0.11.3Beta Was this translation helpful? Give feedback.
All reactions