4

My question is - how to import a library into OpenGL GLSL shader? I mean - is there a way that is supported by OpenGL itself, not a facade over the API which concatenates strings in order to mix shader code with a library code.

1
  • Thx for your question and for the @MikeMx7f answer but it seems to me that there is now appropriate way to make glsl files somekind of moduluar. I also just posted an issue: stackoverflow.com/questions/20604221/…. Commented Dec 16, 2013 at 6:35

1 Answer 1

6

There is no way that is supported by OpenGL itself without extensions. Many engines that wrap OpenGL add their own preprocessor to handle #include macros to solve this problem, but this qualifies as "a facade over the API which concatenates strings in order to mix shader code with a library code."

The ARB_shading_language_include extension provides an OpenGL version of this functionality, but may not be available on your particular machine. For an overview on this extension, see this question: How to Using the #include in glsl support ARB_shading_language_include

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.