Is this possible: two objects with the same instance of a material, sharing the results of dynamic light

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.

hi

Dont know how you like to setup your idea. But my first shot would be to use a system to simulate the effect. I would use a second light on the other object and would use lightning channels to lit only the object you want to copy the light. if you move the lamp on the main object you copy the transforms to the other one.

would need a second Dynamic light and isnt a nice solution.

But dont know what you want to do exactly xD