Does the type of Patterns for primitives can only be used to build distribution of material?

Hi Hao,
yes, you can “stack” modifiers to e.g. modulate brightness and normals, and cut out parts from a surface. Most modifiers act as multiplicators for basis materials, or for modified materials - allowing to chain them:

void <modifierA> <modifierAName>
(...)

<modifierAName> <modifierB> <modifierBName>
(...)

<modifierBName> <basisModel> <modifiedBasisModelName>
0
0
n A1 A(..) An

<modifierA> and <modifierB> can be any of the pattern functions such as brightfunc, colorpict, texfunc etc. <basisModel> stands for one of the reflection or transmission models, such as plastic, metal, trans, … Just make sure that you end up with a plausible result, e.g. that the product of all patterns produces an average of 1 if you want to locally modulate properties rather than change the average.

One exception is the mix*-family of modifiers. These reference the underlying basis materials on the first line of their definition. So here you would blend the modified model defined above with void (may not make much sense):

void mixfunc <mixName>
4 void <modifiedBasisModelName> '0.5' rayinit.cal
0
0

I am just writing this without testing, so I hope I did not include any mistake. But in general, this works pretty well and makes Radiance very flexible. Unfortunately, not all model parameters can be modified with patterns - e.g. the roughness parameter of the basic reflection model, the index of refraction, or the parameters of participating media are fixed.

Best, Lars.

About the idea to cut out parts of a surface using mixfunc, please refer to e.g. Radiance colorpict and perforate.cal

1 Like