This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_checker_frag.glsl
Clément Foucault b4a01e7f4f OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_COLORBAND
Introduced a new checker shader to be used mostly on transparent areas.

OpenGL immediate mode: interface_draw.c (cont)

ui_draw_but_UNITVEC
Introduced a new shader to be used for simple lighting.
2017-02-11 00:39:09 +01:00

25 lines
359 B
GLSL

uniform vec4 color1;
uniform vec4 color2;
uniform int size;
#if __VERSION__ == 120
#define fragColor gl_FragColor
#else
out vec4 fragColor;
#endif
void main()
{
vec2 phase = mod(gl_FragCoord.xy, (size*2));
if ((phase.x > size && phase.y < size) ||
(phase.x < size && phase.y > size))
{
fragColor = color1;
}
else {
fragColor = color2;
}
}