matthewwachter / td-shadertoy

MIT License
73 stars 8 forks source link

Question how to pass an image as input #3

Open RobertoPuglieseFusco opened 1 year ago

RobertoPuglieseFusco commented 1 year ago

Thanks for this great tool!

this is not an issue but a question regarding what is the best way to pass a texture to the loaded shader. I can see there is a container "shadertoyGlobalSamplers". Should I add there a texture and rename it in a certain way? So far I modified manually inside the shadertoyconverter container and navigated through the buffers (e.g. bufA --> sampler0, and so forth) and putting there my image input, but I was wondering if there is a cleaner way.

Thanks!

Roberto

matthewwachter commented 1 year ago

Hey Roberto,

Yeah the current workflow would be to just manually edit like you had mentioned. I wouldn't really say there's much benefit in editing the global samplers collection as that was just an optimization trick I did so I didn't have to create instances of a few performance heavy inputs (e.g. video input top).

It would be nice to have an easy way to cleaner way to do use custom inputs though. Perhaps procedurally generating parameters on the shadertoyConverter component would be the way to go. I'll leave the issue open for now and plan on implementing this in a future update.

Thanks for the suggestion!