indigo icon indicating copy to clipboard operation
indigo copied to clipboard

Add support for GLSL #define statements (and other preprocessors?)

Open davesmith00000 opened this issue 3 years ago • 1 comments

Sometimes we need to be able to make use of preprocessors, for example if we need to set the length of UBO arrays.

The way JavaScript folks seem to do this is by doing string replacement to generate shaders as needed.

Given that we have fixed ways of adding shaders into Indigo, we could allow for either an arbitrary preprocessor block to be defined, or for shaders to be parameterised with arguments that are converted to define statements. Can we do better?

davesmith00000 avatar Aug 21 '21 22:08 davesmith00000

I've actually added support for this in the Roguelike-starterkit, however those are for generated shaders, not custom shaders a user has written. Still, might offer a clue...

davesmith00000 avatar Oct 13 '21 20:10 davesmith00000

I'm confident this is now doable using Ultraviolet shaders.

davesmith00000 avatar Dec 02 '23 22:12 davesmith00000