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

Added #include shader directive. #595

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

Squigglecito
Copy link
Contributor

Added the ability to include other files in a shader with #include "path/to/shader.glsl". Also allows to include built in shader files from ursina/shaders (based on application.package_folder) by using ursina/ at the start of the include path. The include system will recursively go throw the shader sources and apply and includes. Detects and prevents including the same file multiple times (simple add to set and check). This system is simple, and not as ideal as auto importing functionality for the user, but it should allow for shader composition. Shader composition is crucial for reuse of shader code such as lighting. Maybe the asset folder should also be checked for, but I'm not sure whether to consider a shader and asset or just a source file, so I did not add it as a search path.

@pokepetter pokepetter merged commit 7abd96d into pokepetter:master Oct 11, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants