This is an experiment I’m curious about and might be able to do an effect I had an idea for. Basically, I’m trying to have two objects share an instance of a material and the results of lighting.
Imagine, for example, a sphere and a cube, in different rooms. I apply the same material with the same UVs to both.
Over by the cube, I pass a dynamic light in front of it which lights part of it. Way over where the sphere is, I want, magically, that same light to affect its texture (I realize in this example the UVs will be off, and the effect will be distorted on the sphere but that’s okay). If I light the cube then pass a shadow over it, I also want that shadow to appear on my “clone” sphere.
Is there some way to do this? I know the engine works to do the opposite: if I apply the same material to two objects, it makes an instance of each so that when one’s shader calculates light it’s only for itself and wont affect the other. But in this case I do want them entangled.
Maybe the answer is to write a shader than can “intercept” and copy another material’s shadows after its calculated? It’s be great if I could use C++ to assign the same instance of a shader to two objects and then its just does this automatically.