408
edits
Line 1,533: | Line 1,533: | ||
Up to inner_angle, the light will have full intensity. From inner to outer angle the light will linearly fade to outer_gain. From outer angle to zero angle, the light intensity will linearly fade to zero. | Up to inner_angle, the light will have full intensity. From inner to outer angle the light will linearly fade to outer_gain. From outer angle to zero angle, the light intensity will linearly fade to zero. | ||
To better explain the relation of the variables ''inner_angle'', ''outer_angle'' and ''zero angle'', this is the algorithm that produces the scalar value ''directional_fade'' from which the intensity value is defined in the shaders file ''light-ALS.frag'': | |||
<syntaxhighlight lang="xml"> | |||
if (direction > ia) {return 1.0;} | |||
else if (direction > oa) | |||
{return outer_gain + (1.0-outer_gain) * (direction - oa) / (ia - oa);} | |||
else if (direction > za) | |||
{return outer_gain * (direction - za) / (oa - za);} | |||
else {return 0.0;} | |||
</syntaxhighlight> | |||
* to get an automatic strobe effect you can set | * to get an automatic strobe effect you can set |
edits