This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/draw/modes/shaders/paint_vertex_frag.glsl
Jacques Lucke 7c443ded1e Vertex Paint: multiply vertex paint overlay
Fixes the first part of T56999.

Reviewer: brecht

Differential Revision: https://developer.blender.org/D3768
2018-10-05 14:05:48 +02:00

19 lines
380 B
GLSL

in vec3 finalColor;
out vec4 fragColor;
uniform float white_factor = 1.0;
vec3 linear_to_srgb_attrib(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()
{
fragColor.rgb = mix(linear_to_srgb_attrib(finalColor), vec3(1.0), white_factor);
fragColor.a = 1.0;
}