I know I can use shader:send() to change variables, but is there a way to set/change a #define?

  • \$\begingroup\$ Can you elaborate with an example of what you're trying to do? \$\endgroup\$ – DMGregory Jan 19 at 16:35

Shaders don't really work that way. Once the shader is compiled, any instance of the name you defined will be replaced with its value. If you want something that changes throughout your program, use a variable.

  • 1
    \$\begingroup\$ Can you suggest a way that OP can set the #define and compile a new version of the shader with that configuration? \$\endgroup\$ – DMGregory May 26 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.