Sparklify BSDF¶
Description¶
This model takes an area-averaged BSDF as input, and recreates local sparkling effects on it, for simulating materials such as metallic car paints.
The algorithm decomposes the input average BSDF as a field of small tilted mirrors, each one scattering light in a gaussian-shaped light beam. The density parameter controls the size and density of the mirrors.
The roughness controls the sharpness of reflected beams, as a distribution of angular standard deviations. Each small mirror will be randomly attributed a random standard deviation for its reflected beam, according to this distribution.
Note
Using this feature requires an Advanced Edition license
Children Nodes¶
The input average BSDF |
Parameters¶
name |
type |
description |
---|---|---|
density |
real |
The density of sparkles, per square millimeter |
roughness |
table |
The tabulated distribution of particle roughness. The first column is the angular standard deviation and should be ordered. The second column is the angle probability density and does not need to be normalized. |
Ocean XML 6.1 example¶
<bsdf type="sparklify" name="bsdf1" density="40">
<param name="roughness" type="list">
<row angle="0.00218166" value="0"/>
<row angle="0.00654498" value="15174"/>
<row angle="0.0109083" value="24150.2"/>
<row angle="0.0152716" value="26860.2"/>
<row angle="0.019635" value="38649.5"/>
<row angle="0.0239983" value="33354.1"/>
<row angle="0.0283616" value="28720.3"/>
<row angle="0.0327249" value="23520.2"/>
<row angle="0.0370882" value="20225.4"/>
<row angle="0.0414516" value="18106.2"/>
<row angle="0.0458149" value="17294.7"/>
<row angle="0.0501782" value="16013.1"/>
<row angle="0.0545415" value="11837.7"/>
<row angle="0.0589049" value="11366.5"/>
<row angle="0.0632682" value="7728.64"/>
<row angle="0.0676315" value="9678.61"/>
<row angle="0.0719948" value="6901.28"/>
<row angle="0.0763582" value="5940.18"/>
<row angle="0.0807215" value="4383.07"/>
<row angle="0.0850848" value="4979.57"/>
<row angle="0.0894481" value="3120.16"/>
<row angle="0.0938114" value="1559.82"/>
<row angle="0.0981748" value="1275.27"/>
<row angle="0.102538" value="2116.22"/>
<row angle="0.106901" value="1623.63"/>
<row angle="0.111265" value="1286.65"/>
<row angle="0.115628" value="1391.31"/>
<row angle="0.119991" value="1940.08"/>
<row angle="0.124355" value="974.579"/>
<row angle="0.128718" value="650.981"/>
<row angle="0.133081" value="705.762"/>
<row angle="0.137445" value="914.645"/>
</param>
<bsdf type="reflective" name="bsdf" rereflections="true">
<roughness type="beckmann" name="roughness">
<scalarshader type="uniform" name="roughness" value="0.14"/>
</roughness>
<intlaw type="cfresnel" name="intlaw">
<dielectricfunc type="linked" name="dielectricfunc" target="ocean-metals::W"/>
</intlaw>
</bsdf>
</bsdf>