diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl index a356014d025..18f58d52f32 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl @@ -8,33 +8,31 @@ out vec4 fragColor; vec4 do_checkerboard() { - float size = checkerColorAndSize.z; - vec2 phase = mod(gl_FragCoord.xy, size * 2.0); - - if ((phase.x > size && phase.y < size) || - (phase.x < size && phase.y > size)) - { - return vec4(checkerColorAndSize.xxx, 1.0); - } - else { - return vec4(checkerColorAndSize.yyy, 1.0); - } + float size = checkerColorAndSize.z; + vec2 phase = mod(gl_FragCoord.xy, size * 2.0); + + if ((phase.x > size && phase.y < size) || (phase.x < size && phase.y > size)) { + return vec4(checkerColorAndSize.xxx, 1.0); + } + else { + return vec4(checkerColorAndSize.yyy, 1.0); + } } void main() { - if (min(1.0, -butCo) > discardFac) { - discard; - } + if (min(1.0, -butCo) > discardFac) { + discard; + } - fragColor = finalColor; + fragColor = finalColor; - if (butCo > 0.5) { - vec4 checker = do_checkerboard(); - fragColor = mix(checker, fragColor, fragColor.a); - } + if (butCo > 0.5) { + vec4 checker = do_checkerboard(); + fragColor = mix(checker, fragColor, fragColor.a); + } - if (butCo > 0.0) { - fragColor.a = 1.0; - } + if (butCo > 0.0) { + fragColor.a = 1.0; + } } |