Welcome to mirror list, hosted at ThFree Co, Russian Federation.

paint_vertex_vert.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 178f77c6b9c378a96ff75f8b839bce3b1d227761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

uniform mat4 ModelViewProjectionMatrix;

in vec3 pos;
in vec3 color;

out vec3 finalColor;

vec3 srgb_to_linear_attrib(vec3 c) {
	c = max(c, vec3(0.0));
	vec3 c1 = c * (1.0 / 12.92);
	vec3 c2 = pow((c + 0.055) * (1.0 / 1.055), vec3(2.4));
	return mix(c1, c2, step(vec3(0.04045), c));
}

void main()
{
	gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);

	finalColor = srgb_to_linear_attrib(color);
}