I added a basic fog of war to my game, texture 512*512 and I would like all objects to be shaded based on that texture. For a single object I have to convert the material from spatial to shader material, copy the shading function which checks whether the object is in fog and does bilinear interpolation, and feed the texture to the shader. I have to do this flow for all the materials. Is there an option to do it programmatically, so I don't have to do it manually for each material? Or at least share/import function in material shaders so if I want to update the function, I don't have to update it in million materials?