kind of a "live compositing" node, allowing to precisely control the contribution of each ray type :
Plugged in the opacity of a material it allows to lower visibility or hide an object in reflection, refraction, AO ,shadow , diffuse or camera.
Or can be used for example, as "amount" attribute of a mix texture/ mix material node, or in emission texture, ect ...
> The blue sphere is not visible in reflection and refraction
- Code: Select all
shader raytype_contribution(
float cam = 1 [[string label = "Camera", float min=0, float max=1]],
float shad = 1 [[string label = "Shadow", float min=0, float max=1]],
float AO = 1 [[string label = "Ambient occlusion", float min=0, float max=1]],
float diff = 1 [[string label = "Diffuse", float min=0, float max=1]],
float refl = 1 [[string label = "Reflection", float min=0, float max=1]],
float refr = 1 [[string label = "Refraction", float min=0, float max=1]],
output color c = 0
)
{
c = cam*raytype("camera") + shad*raytype("shadow") + AO*raytype("AO")
+ diff*raytype("diffuse") + refl*raytype("reflection") + refr*raytype("refraction");
}
EDIT: sorry there was a last minute bug in the script, this is fixed thanks to Milanm.
The shader seems to works just fine now.