Maybe a crazy question, but it there a way to set a colour input to match the colour of the closest material/mesh?
For example, if I had a cube that I wanted to dynamically adopt the colour of the nearest surface - so if it touched a green surface it would be green, if it touched a red surface it would be red.
Asking out of curiosity and because, if it is possible, it would be really useful for making dynamic procedural materials
Hm I donât think so? (I donât really know what radiosity is but I gather itâs more to do with lightâŚ?)
All I was wondering was if there is a way to set an objectâs colour to match the colour of whatever it touches. Like a node set up that samples the colour input from whatever other material colour it comes into contact with!
For a similar purpose (material blending between different objects with minimal seams) best I could come up with in blender is to have a master material where all the object materials are in (node groups usage is probably helpful here) and then blend the mixing with dynamic paint or AO (worse solution, as in eevee it changes based on the viewing angle).
I donât think thereâs a easy solution for something like that natively in blender. Something like animation nodes might work in your case.
Aha yes I know, but I mean for the colour to change dynamically for use in a procedural material.
For example, if I created a fruit stem and I could set the base of the stem to match the colour of whatever itâs touching then you could create a stem material that anyone could download and it would automatically match the colour of whatever fruit they were making.
Iâm starting to think itâs probably too complicated - just thought it would be a cool addition to procedural materials to make them more versatile and easy for the downloader to incorporate into their scene!
This is with AO. Plenty of problems with it, but other options require baking or longer set up. Would be nice if there was something like distance fields in blender.
Itâs just the ground plane material in a node group so I could access it in another material. Using object normals with a empty controlling the transforms so they would match up. Only works okay in Cycles though, since eevee AO is too inconsistent.
I am not aware of a way to do this with only the shader because you can not pipe other objects into the shader.
You would need something to control a color node or something like that in the shader.
You could do this with python, drivers, animation nodes or something like that but I do not think you can do that with the available shader nodes.
Perhaps you could try it with OSL but hen you lose GPU support which you might not want to lose.
It was possible to trace some rays, and get at least the âmaterial_idâ from the hitted raysâŚ
But Iâve tested in 2.83 and this is not working nowâŚ(material id returns 32603 no matter which index it has).
Theoretically, it would be possible to even get the Ci (full closures) from the hits, but afaik this never worked.
How exactly would radiosity be used to achieve the colour matching effect though? (Iâm a total noob to this so I really donât understand whatâs going on )