Wow, thanks, that looks like you put a lot of work into it! But how exactly can I use it? I’ve selected the script it in a Script node, and pluggd the output factor into a Mix node for the Base Color, but I only get a 50/50 mix of both colors. This is how it looks (in Cycles, obviously):
Am I doing it wrong?
EDIT: Nevermind, I missed activating OSL in the render settings. Thanks so much for this!
Now that it’s working though, I still have a few questions:
Right now, as soon as I make the influencing object invisible, it doesn’t create the texture anymore. Would it be possible to make this work even if the object is invisible?
Also is there any way to select which object (or even better: which collection) is included in the calculation, so that only the objects in the selected collection are creating the effect? (even the object using the texture is influencing itself, which becomes obvious when activating “backface”)