For some time now I’ve been a fan and modder of a certain game which uses its own asset database similar to the one in the Unity editor - at the start, it loads all the models and textures in its directory and converts them into GameObjects, etc. so as to make the game expandable and mod-friendly.
Currently I have a mod written that uses a custom shader, which can be imported into the game using “Material(string)”. However, recently when using this function in the Unity Editor, I’ve been presented with a message that Material(string) is “obsolete” and will be removed in the future. In the interest of not being blindsided when this happens, I’d like to know what alternate options there are for loading a shader at runtime like this.
I’ve already looked over Material(string) is Obsolete - Questions & Answers - Unity Discussions and done some Google searches that took me to old webpages (February 2015 or earlier) that are no longer relevant.
The “obvious” solution as recommended in the editor and most places I’ve seen is to “use shader assets”, but unless I myself am the developer of the game, I can’t do that - and even if I were, I can’t be expected to recompile the game for every user out there based on whether or not they want my mod.
So someone please tell me if there is some way to load shaders during game runtime, perhaps from text, from a compiled shader file I have created previously, or otherwise!
Or if not, can anyone confirm that when this function does get removed, the Unity team has plans to introduce a substitute?