Re-added files that were corrupted
This commit is contained in:
19
Renders/Office/Monitor/alpha_transparency.gdshader
Normal file
19
Renders/Office/Monitor/alpha_transparency.gdshader
Normal file
@@ -0,0 +1,19 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
// Parameters
|
||||
uniform float alpha_threshold : hint_range(0.0, 1.0) = 0.1; // below this = fully transparent
|
||||
uniform float alpha_modifier : hint_range(0.0, 1.0) = 1.0; // global alpha multiplier
|
||||
|
||||
void fragment() {
|
||||
// Sample the texture
|
||||
vec4 tex_color = texture(TEXTURE, UV);
|
||||
|
||||
// Use the texture's alpha channel directly
|
||||
float alpha = tex_color.a < alpha_threshold ? 0.0 : tex_color.a;
|
||||
|
||||
// Apply global modifier
|
||||
alpha *= alpha_modifier;
|
||||
|
||||
// Preserve original RGB, apply computed alpha
|
||||
COLOR = vec4(tex_color.rgb, alpha);
|
||||
}
|
||||
Reference in New Issue
Block a user