Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into supporting #include for shaders #69

Open
einarf opened this issue Mar 22, 2020 · 5 comments
Open

Look into supporting #include for shaders #69

einarf opened this issue Mar 22, 2020 · 5 comments
Labels
Documentation Issues related to documentation

Comments

@einarf
Copy link
Member

einarf commented Mar 22, 2020

We should look into supporting #include for shaders.

#version 330
#include utils/functions.glsl
...

Need to figure out how to handle line numbers.

einarf added a commit that referenced this issue Mar 23, 2020
@einarf
Copy link
Member Author

einarf commented Mar 23, 2020

Done. Need to document this. We can include up to 100 levels of sources as max sanity check.

utils.glsl

// A bunch of functions

library.glsl

#include path/to/utils.glsl
#incluide path/to/utils_2.glsl
#incluide path/to/utils_3.glsl
...

test.glsl

#version 330
#include path/to/library.glsl
#include path/to/something_else.glsl

@einarf
Copy link
Member Author

einarf commented Mar 24, 2020

@einarf einarf added the Documentation Issues related to documentation label Aug 23, 2020
@einarf
Copy link
Member Author

einarf commented Jun 25, 2021

Seriously considering revamping this one a bit.

@loreno-heer
Copy link
Contributor

For some reason this seems to run into problems with includes of the form #include "somepath/somefile". In particularly when trying to include the lygia shader library and the cnoise function for example.

@einarf
Copy link
Member Author

einarf commented Nov 30, 2024

Issues with quotes was resolved. Still a lot more here that could be done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to documentation
Projects
None yet
Development

No branches or pull requests

2 participants