Skip to content

Commit

Permalink
fix compatibility decal alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtarsia committed Sep 27, 2024
1 parent 618f60d commit ac4b2e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shaders/editor_functions.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ uniform sampler2D[3] _editor_decal : source_color, filter_linear, repeat_disable
uniform vec2 _editor_decal_position[3];
uniform float _editor_decal_size[3];
uniform float _editor_decal_rotation[3];
uniform vec3 _editor_decal_color[3] : source_color;
uniform vec4 _editor_decal_color[3] : source_color;
uniform bool _editor_decal_visible[3];

// expects uv (Texture/world space 0 to +/- inf 1m units).
Expand All @@ -50,7 +50,7 @@ vec3 get_decal(vec3 albedo, vec2 uv) {
continue;
}
float decal = smoothstep(0.1,1.0,texture(_editor_decal[i],decal_uv + 0.5).r);
albedo = mix(albedo, _editor_decal_color[i], clamp(decal * 0.25, 0.0, 0.25));
albedo = mix(albedo, _editor_decal_color[i].rgb, decal * _editor_decal_color[i].a);
}

return albedo;
Expand Down

0 comments on commit ac4b2e2

Please sign in to comment.