Add renderer state defines to shader preprocessor#98549
Conversation
2a697ec to
c061093
Compare
c061093 to
e021076
Compare
|
Could this perhaps be extended to include a couple of renderer feature support flags based on current renderer (see godotengine/godot-proposals#6207) and not just current renderer? For me instance uniform support The use case would be similar to the idea behind this PR as I understand it, as well as the logic and place to add it I think. But such feature flags would allow shaders to adapt and start using features as support is added in the engine without the developer needing to keep track of what is supported in each renderer/shader type and change their shader code. |
I think that's an interesting idea, but is way out of scope for this PR. As for instance uniforms, they are fully supported in all rendering backends now. So there should be no need for a flag |
|
Looks good, we should make a corresponding docs PR before merging. |
|
I created the docs PR: godotengine/godot-docs#10231. |
|
Thanks! |
Closes godotengine/godot-proposals#10764
implements 4 built-in defines to shader preprocessor:
CURRENT_RENDERERis either0,1,2(depends on current renderer)RENDERER_COMPATIBILITYis0RENDERER_MOBILEis1RENDERER_FORWARD_PLUSis2Using it is simple: