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

#include statement in shader language #2674

Closed
mnkylord opened this issue Apr 30, 2021 · 1 comment
Closed

#include statement in shader language #2674

mnkylord opened this issue Apr 30, 2021 · 1 comment
Labels

Comments

@mnkylord
Copy link

Describe the project you are working on

I am building a JRPG style game in 3D.

Describe the problem or limitation you are having in your project

Shader languages lack noises. So I watched tutorials and read sites on noises and wrote a library of noise generator functions. But copying and pasting them makes managing shaders codes very dirty and difficult.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It will be great if the shader language has #include functionality like C/C++. With it, shaders can share common libraries. This makes shader codes much cleaner and also much easier to optimize.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Using #include statements in shaders will make codes much cleaner instead of copying-and-pasting shader functions.

If this enhancement will not be used often, can it be worked around with a few lines of script?

As far as I understand, no.

Is there a reason why this should be core and not an add-on in the asset library?

I suppose it is possible to have an add-on that performs macros in shader codes. But in my opinion, #include is just a cleaner and better solution.

@clayjohn
Copy link
Member

Duplicate of #944

Please search existing proposals before creating one of your own.

If you have anything to add to #944 please post it as a comment instead of creating a new proposal.

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

No branches or pull requests

2 participants