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

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

uniform vec4 color;

#if __VERSION__ == 120
  #define fragColor gl_FragColor
#else
  out vec4 fragColor;
#endif

void main()
{
	vec2 centered = gl_PointCoord - vec2(0.5);
	float dist_squared = dot(centered, centered);
	const float rad_squared = 0.25;

	// round point with jaggy edges
	if (dist_squared > rad_squared)
		discard;

	fragColor = color;
}