I have a 3D-model of the human body and now want to "highlight" certain parts of it. Is there a way to take a sphere for example and use it as a mask, to change the intersecting geometry of the body and the sphere to an emissive material?
2 Answers
One way would be to have a sphere with an emissive material on it and disable Ray Visibility for Camera and Shadow. This way the emissive sphere would highlight the body wherever they are intersecting (but also the inside and every other object the sphere is intersecting):
Another and probably better way would be to place an empty in the scene (which shape does not really matter, I've taken a sphere in this case) and in the material of the body you reference this empty in a Texture Coordinate node. With a Vector Math node you calculate the distance from the empty's origin and with a Math node set to Less Than you control the influence radius. Below a certain distance, the Math node outputs 1, above 0 - this value I use as Emission Strength in a Principled BSDF node which is my material on the object. Of course you can use the value in all kinds of nodes as a mix factor:
Just to give you an idea what else you can do with this value, here I've used it to drive the Base Color, the Metallic value, the Roughness and the Transmission in a single Principled BSDF node:
-
1
It's probably a more limited way, but it's also possible to use Light Path node and transparent shader on the other object to mix based on transparent depth. It might get messy if you need other transparent shaders in the scene(you could then use Transmission Depth and Refraction BSDF with IOR set to 1 as well), but you could have any shape of volume.