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
Talked about this with @alejot127 last week. I'm still trying to familiarize myself with the codebase and how shows and scenes are constructed; I was hoping to merge a couple of new shaders I've written, but there doesn't seem to be any common library for where all our shaders are stored. It looks like most of the shaders just get added as stringified glsl code in a .sparkle file.
At the moment, if I go to make a new show, I'm limited to only using the shaders provided by the template show. Having shows maintain their own separate list of shaders is good especially if we add a ton of new shaders in the future, but when you go to make a new show, I think it could be good to have a "add shader" button which shows the list of all available shaders codebase. Then you can add whichever ones you want into the show's shader library, and the .sparkle file will only need to maintain a reference to where the code is, rather than maintaining its own independent version of the shader code.
Proposal:
Instead of including the body of the code for each in the show's .sparkle file, can we just include the name of the shader and have it pull the code from the directory at src/commonMain/resources/shader-libraries/built-in? This would make it a lot easier to add/edit shaders and would also mean that new shows could access all of the shader assets. We could either assume that the shaders are named as <Shader Name>.glsl or have it reference the existing _libraryIndex.json file.
@xian Does this sound like a good idea? I can start consolidating all of the shaders into a common library and add a few of my own if it seems feasible for you to make the changes of how the shader code is referenced on the Kotlin side of things.
The text was updated successfully, but these errors were encountered:
Actually you can add shaders from that built-in shader library:
Screen.Recording.2022-06-15.at.5.01.03.PM.mov
… errr, you're supposed to be able to. Not sure what that error at the end is about. I'll investigate.
But, yeah, currently shaders live in the show JSON (.sparkle) file. It'd be nice to have a way to link out to resources like shaders, but it quickly gets into versioning questions and stuff... Def interested in talking it through though. I'd really like to come up with an easy way for people to share their work, maybe via git repos or some other community-accessible thing.
For now maybe just drop stuff into the built-in dir though?
Trello card: https://trello.com/c/dwCvAw2N
Talked about this with @alejot127 last week. I'm still trying to familiarize myself with the codebase and how shows and scenes are constructed; I was hoping to merge a couple of new shaders I've written, but there doesn't seem to be any common library for where all our shaders are stored. It looks like most of the shaders just get added as stringified glsl code in a
.sparkle
file.At the moment, if I go to make a new show, I'm limited to only using the shaders provided by the template show. Having shows maintain their own separate list of shaders is good especially if we add a ton of new shaders in the future, but when you go to make a new show, I think it could be good to have a "add shader" button which shows the list of all available shaders codebase. Then you can add whichever ones you want into the show's shader library, and the
.sparkle
file will only need to maintain a reference to where the code is, rather than maintaining its own independent version of the shader code.Proposal:
Instead of including the body of the code for each in the show's .sparkle file, can we just include the name of the shader and have it pull the code from the directory at
src/commonMain/resources/shader-libraries/built-in
? This would make it a lot easier to add/edit shaders and would also mean that new shows could access all of the shader assets. We could either assume that the shaders are named as<Shader Name>.glsl
or have it reference the existing_libraryIndex.json
file.@xian Does this sound like a good idea? I can start consolidating all of the shaders into a common library and add a few of my own if it seems feasible for you to make the changes of how the shader code is referenced on the Kotlin side of things.
The text was updated successfully, but these errors were encountered: