1
\$\begingroup\$

I haven't ever seen anyone declare main as anything but void main() or void main(void) but I'm curious, is it possible to have a parameter or return value?

\$\endgroup\$
5
\$\begingroup\$

No, glsl can't have parameters in the main function (as well as return values).

The doc says:

Just like in C/C++, execution of a shader begins with the function main. This function takes no parameters and returns no values.

\$\endgroup\$

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.