blob: 1a9da98c1fa91ff722a4cb6f8217f63f7d0d79fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#pragma BLENDER_REQUIRE(common_colormanagement_lib.glsl)
void main()
{
vec2 uvs_clamped = clamp(uvs, 0.0, 1.0);
vec4 tex_color;
tex_color = texture_read_as_linearrgb(imgTexture, imgPremultiplied, uvs_clamped);
fragColor = tex_color * ucolor;
if (!imgAlphaBlend) {
/* Arbitrary discard anything below 5% opacity.
* Note that this could be exposed to the User. */
if (tex_color.a < 0.05) {
discard;
}
else {
fragColor.a = 1.0;
}
}
/* Pre-multiplied blending. */
fragColor.rgb *= fragColor.a;
}
|