-
Notifications
You must be signed in to change notification settings - Fork 239
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
Adding support for shader includes pre-processor directives #269
Conversation
This way we can see engine and editor resources, such as shaders, directly in visual studio
Also changing the project kind for "Resources" from "None" to "SharedItems"
e3afb5e
to
2d260a9
Compare
Rebased the PR following the merge of #277 |
@maxbrundev @litelawliet I might need some help on this one to define the default extension for partial shader files (shader files that are included, but cannot be compiled by themselves). Right now it's:
The reason I kept We could also change the extension, or have 2 extension: |
@litelawliet @maxbrundev I went with I've found one current limitation with this implementation, which might need further work (maybe in another PR?). I'm also considering using |
Related documentation: |
Description
Added support for shader includes, which allow us to reuse code between shaders:
The
Overload/Resources/
folder has been added to premake as a separate project, so this way we can see and edit resources (such as engine and editor shaders) directly from VS (or any other IDE of your choice).Review Guidance
Now passing an optional
path
torealPath
conversion function to theShaderLoader
class, to be able to parse and load included files based on rules set by the caller (OvCore
). This wayOvRendering
doesn't have to be aware of our folder architecture.If a file starting with
:
is included, ie:The
ShaderLoader
will resolve the file path and look into the Engine folder.If no
:
is provided, it will look into the user project's assets, ie:Some conventions have been introduced:
*.ovfx
*.ovfxh
Example
Limitations
The current implementation doesn't support including the same shader file multiple time, and doing so will potentially result into compilation errors.
Screenshots
Addition of the "Resources" project (SharedItems)
Related Issues
Fixes #104