render.SetBlend
Description
Sets the alpha blending (or transparency) for upcoming render operations.
See render.SetColorModulation for the function to affect RGB color channels.
By itself, this will cause visible overlapping on parts of a model that are in front of other parts of the same model.
For a solution to this, see the examples below.
If a material has the $alphatest flag enabled then this function might not behave as expected because alpha will be binary, this has a default cutoff of
0.7
.Arguments
1 number blending
The alpha (transparency) for upcoming draw operations.
A value in the range
A value in the range
(0-1)
where 0
is fully transparent, 0.5
is 50% visible, and 1
is fully opaque.Example: Basic Usage (With overlaps)
This example demonstrates the basic usage of render.SetBlend and the overlapping effect mentioned above.
Output:
Example: Avoiding Overlap Issues
This example demonstrates how the overlapping effect can be avoided with the use of render.OverrideColorWriteEnable
Output: