This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/modes/shaders/paint_vertex_frag.glsl
Jeroen Bakker 7bc300a74b Fix T67587: Fix Drawing in Wireframe Non X-Ray Mode
When using Vertex or Weight paint mode on a wireframe the overlay was
blended with the background. In this case we now use alpha blending.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5340
2019-08-08 08:00:57 +02:00

25 lines
472 B
GLSL

in vec3 finalColor;
out vec4 fragColor;
uniform float opacity = 1.0;
vec3 linear_to_srgb_attr(vec3 c)
{
c = max(c, vec3(0.0));
vec3 c1 = c * 12.92;
vec3 c2 = 1.055 * pow(c, vec3(1.0 / 2.4)) - 0.055;
return mix(c1, c2, step(vec3(0.0031308), c));
}
void main()
{
vec3 color = linear_to_srgb_attr(finalColor);
#ifdef DRW_STATE_BLEND_ALPHA
fragColor = vec4(color, opacity);
#else
fragColor.rgb = mix(vec3(1.0), color, opacity);
fragColor.a = 1.0;
#endif
}