Open BastiaanOlij opened 3 months ago
I would prefer reusing the remap system as it doesn't see much use currently.
I would prefer reusing the remap system as it doesn't see much use currently.
Yes I would agree, when I wrote this I wasn't aware we had that system but it seems much better suited.
Describe the project you are working on
VR application exported to both stand alone headsets (Android, Mobile renderer) and desktop (PC, Forward+ renderer)
Describe the problem or limitation you are having in your project
I want to set up shaders and materials differently depending on the renderer or platform I'm exporting too without needing code that changes them when the wrong versions have already been compiled on scene loading.
Especially with the new custom shader templates this will become even more of a problem if you wish to target multiple platforms/renderers.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The solution I'm thinking off is adding a preprocessor to paths. We already parse
res://
anduser://
etc. We could easily extend this logic to parse additional markers.For instance we could have a path like
res://%rendering_method%/textured.gdshader
that would be parsed tores://forward_clustered/textured.gdshader
.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
We create a static registry where different parts of Godot can register keywords. For instance for the above example to work we would do:
or potentially this code could be in
Main::setup
and react to a number of keywords we set there (rendering_method, platform, etc.)In our
DirAccess
andFileAccess
classes we add a parse function for the path that we call at the start of functions likeFileAccess::open
.If this enhancement will not be used often, can it be worked around with a few lines of script?
This requires core changes
Is there a reason why this should be core and not an add-on in the asset library?
This requires core changes