Semi-transparent
Build-in effects - Semi-transparent
Last edited 2026-02-27
This effect provides transparency. It is not recommended to use this effect because Alpha Coeff has 256 levels of visibility instead of 128, and Alpha Coeff is also faster.
Input data:
- Self (Main texture of the object/layer, depending on where you apply the effect; contains information about Red, Green, Blue, Alpha)
- Background (Second texture that contains information about Red, Green, Blue, Alpha* pixels that are underneath Self)
- Coeff (An integer variable ranging from 0 to 127 controlling visibility)
Output data:
- Render (Red, Green, Blue, Alpha colors that will be displayed on the screen)
Example written in pseudocode:
load float4 Self; // LOAD main texture
load float4 Background; // LOAD texture underneath main texture
global int Coeff; // LOAD global variable controlling visibility
int4 SelfInt = ceil(Self * 255) * (128 - Coeff); // Conversion of float to int of color Self and multiplication by differences from Coeff
int4 BackgroundInt = ceil(Background * 255) * Coeff; // Conversion of float to int of color Background and multiplication by Coeff
int4 RenderInt = ceil((SelfInt + BackgroundInt) / 128); // Calculating the average
float4 Render = float4(RenderInt / 255.0f); // Converting the result from int to float and normalizing so that colors are in the range from 0.0 to 1.0
return Render; // Return the Render
Examples of recreation effects created by the community:
- Semi-Transparent (Background) by Foxioo; It does the same shader but has more options for modifying the color output.
The meaning of colors in the Type column:
|
Color |
Description |
|
Green |
This effect works in this runtime. |
|
Yellow |
It is unknown whether it works (requires confirmation) |
|
Red |
This effect does not work in this runtime. |
|
Effect |
Description |
Windows (Software / DirectDraw) |
Windows (Direct3D 8) |
Windows (Direct3D 9) |
Windows (Direct3D 11) |
Android (OpenGL ES) |
iOS (OpenGL ES) |
macOS (OpenGL ES) |
HTML5 |
Haxe (Linux) |
Haxe (WebGL) |
|
Color transparency on a scale from 0 to 127; (0 means visible, 127 means not visible) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Unknown |
Unknown |
Unknown |
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation Process with HelpNDoc's Advanced Features