-
Notifications
You must be signed in to change notification settings - Fork 10
/
line.glslf
45 lines (32 loc) · 1.49 KB
/
line.glslf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#version GLSL_VERSION
/*==============================================================================
VARS
==============================================================================*/
#var ALPHA 0
/*==============================================================================
INCLUDES
==============================================================================*/
#include <precision_statement.glslf>
#include <std.glsl>
#include <color_util.glslf>
/*==============================================================================
UNIFORMS
==============================================================================*/
uniform vec4 u_diffuse_color;
/*==============================================================================
SHADER INTERFACE
==============================================================================*/
//------------------------------------------------------------------------------
GLSL_OUT vec4 GLSL_OUT_FRAG_COLOR;
/*==============================================================================
MAIN
==============================================================================*/
void main() {
vec3 color = u_diffuse_color.xyz;
float alpha = u_diffuse_color.a;
lin_to_srgb(color);
#if ALPHA
premultiply_alpha(color, alpha);
#endif
GLSL_OUT_FRAG_COLOR = vec4(color, alpha);
}