2016-08-21 18:20:27 +02:00
|
|
|
const char *im2d_vert_src =
|
|
|
|
"#version 330\n"
|
|
|
|
|
2017-08-29 10:12:56 +02:00
|
|
|
"layout(std140) uniform State\n"
|
|
|
|
"{\n"
|
|
|
|
" int u_alphaTest;\n"
|
|
|
|
" float u_alphaRef;\n"
|
|
|
|
|
|
|
|
" int u_fogEnable;\n"
|
|
|
|
" float u_fogStart;\n"
|
|
|
|
" float u_fogEnd;\n"
|
|
|
|
" vec4 u_fogColor;\n"
|
|
|
|
"};\n"
|
2017-08-27 17:13:10 +02:00
|
|
|
|
|
|
|
"uniform vec4 u_xform;\n"
|
2016-08-21 18:20:27 +02:00
|
|
|
|
2017-08-27 17:13:10 +02:00
|
|
|
"layout(location = 0) in vec4 in_pos;\n"
|
2016-08-21 18:20:27 +02:00
|
|
|
"layout(location = 2) in vec4 in_color;\n"
|
|
|
|
"layout(location = 3) in vec2 in_tex0;\n"
|
|
|
|
|
|
|
|
"out vec4 v_color;\n"
|
|
|
|
"out vec2 v_tex0;\n"
|
2017-08-29 10:12:56 +02:00
|
|
|
"out float v_fog;\n"
|
2016-08-21 18:20:27 +02:00
|
|
|
|
|
|
|
"void\n"
|
|
|
|
"main(void)\n"
|
|
|
|
"{\n"
|
2017-08-27 17:13:10 +02:00
|
|
|
" gl_Position = in_pos;\n"
|
|
|
|
" gl_Position.xy = gl_Position.xy * u_xform.xy + u_xform.zw;\n"
|
|
|
|
" gl_Position.xyz *= gl_Position.w;\n"
|
2016-08-21 18:20:27 +02:00
|
|
|
" v_color = in_color;\n"
|
|
|
|
" v_tex0 = in_tex0;\n"
|
2017-08-29 10:12:56 +02:00
|
|
|
" v_fog = clamp((gl_Position.z - u_fogEnd)/(u_fogStart - u_fogEnd), 0.0, 1.0);\n"
|
2016-08-21 18:20:27 +02:00
|
|
|
"}\n"
|
|
|
|
;
|