From a7110618ff3205e2389768f1c387f263dc0d4da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 27 Mar 2020 17:20:48 +0100 Subject: Cleanup: GPUShader: Remove unused shaders --- source/blender/gpu/CMakeLists.txt | 7 -- source/blender/gpu/GPU_shader.h | 27 ----- source/blender/gpu/intern/gpu_shader.c | 100 ----------------- .../gpu_shader_2D_smooth_color_dithered_frag.glsl | 18 ---- .../gpu_shader_3D_normal_smooth_color_vert.glsl | 22 ---- .../shaders/gpu_shader_image_depth_copy_frag.glsl | 12 --- .../gpu_shader_image_depth_linear_frag.glsl | 16 --- .../gpu_shader_image_multisample_resolve_frag.glsl | 119 --------------------- ...er_simple_lighting_smooth_color_alpha_frag.glsl | 14 --- ...u_shader_simple_lighting_smooth_color_frag.glsl | 16 --- .../gpu/shaders/gpu_shader_uniform_color_frag.glsl | 4 - 11 files changed, 355 deletions(-) delete mode 100644 source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl delete mode 100644 source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl delete mode 100644 source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl delete mode 100644 source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl delete mode 100644 source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl delete mode 100644 source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl delete mode 100644 source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index cf1d449ad3b..a8a0288f895 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -146,8 +146,6 @@ data_to_c_simple(shaders/gpu_shader_uniform_color_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_checker_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_diag_stripes_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_simple_lighting_frag.glsl SRC) -data_to_c_simple(shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl SRC) -data_to_c_simple(shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_flat_color_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_flat_id_frag.glsl SRC) @@ -165,7 +163,6 @@ data_to_c_simple(shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_2D_line_dashed_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_2D_smooth_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_2D_smooth_color_frag.glsl SRC) -data_to_c_simple(shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_2D_image_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_2D_image_rect_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_2D_image_multi_rect_vert.glsl SRC) @@ -179,16 +176,12 @@ data_to_c_simple(shaders/gpu_shader_image_modulate_alpha_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_image_alpha_color_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_image_color_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_image_varying_color_frag.glsl SRC) -data_to_c_simple(shaders/gpu_shader_image_depth_linear_frag.glsl SRC) -data_to_c_simple(shaders/gpu_shader_image_depth_copy_frag.glsl SRC) -data_to_c_simple(shaders/gpu_shader_image_multisample_resolve_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_image_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_normal_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_flat_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_smooth_color_vert.glsl SRC) -data_to_c_simple(shaders/gpu_shader_3D_normal_smooth_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_passthrough_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl SRC) diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index 334e295c636..bb26f5d41a3 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -107,10 +107,6 @@ typedef enum eGPUBuiltinShader { GPU_SHADER_TEXT, GPU_SHADER_KEYFRAME_DIAMOND, GPU_SHADER_SIMPLE_LIGHTING, - GPU_SHADER_SIMPLE_LIGHTING_FLAT_COLOR, - GPU_SHADER_SIMPLE_LIGHTING_SMOOTH_COLOR, - GPU_SHADER_SIMPLE_LIGHTING_SMOOTH_COLOR_ALPHA, - /* for simple 2D drawing */ /** * Take a single color for all the vertices and a 2D position for each vertex. @@ -133,7 +129,6 @@ typedef enum eGPUBuiltinShader { * \param pos: in vec2 */ GPU_SHADER_2D_SMOOTH_COLOR, - GPU_SHADER_2D_SMOOTH_COLOR_DITHER, GPU_SHADER_2D_IMAGE, GPU_SHADER_2D_IMAGE_COLOR, GPU_SHADER_2D_IMAGE_DESATURATE_COLOR, @@ -141,14 +136,6 @@ typedef enum eGPUBuiltinShader { GPU_SHADER_2D_IMAGE_ALPHA, GPU_SHADER_2D_IMAGE_RECT_COLOR, GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_2, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_4, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_8, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_16, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_2_DEPTH_TEST, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_4_DEPTH_TEST, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_8_DEPTH_TEST, - GPU_SHADER_2D_IMAGE_MULTISAMPLE_16_DEPTH_TEST, GPU_SHADER_2D_CHECKER, GPU_SHADER_2D_DIAG_STRIPES, /* for simple 3D drawing */ @@ -159,8 +146,6 @@ typedef enum eGPUBuiltinShader { * \param pos: in vec3 */ GPU_SHADER_3D_UNIFORM_COLOR, - /* Sets Z-depth to 1.0 (draw onto background). */ - GPU_SHADER_3D_UNIFORM_COLOR_BACKGROUND, /** * Take a 3D position and color for each vertex without color interpolation. * @@ -196,18 +181,6 @@ typedef enum eGPUBuiltinShader { * \param pos: in vec3 */ GPU_SHADER_3D_IMAGE_MODULATE_ALPHA, - /** - * Draw linearized depth texture relate to near and far distances. - * Take a 3D position and a 2D texture coordinate for each vertex. - * - * \param znear: uniform float - * \param zfar: uniform float - * \param image: uniform sampler2D - * \param texCoord: in vec2 - * \param pos: in vec3 - */ - GPU_SHADER_3D_IMAGE_DEPTH, - GPU_SHADER_3D_IMAGE_DEPTH_COPY, /* points */ /** * Draw round points with a hardcoded size. diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index c6ffcfa2d86..1a0daf4ac41 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -54,9 +54,6 @@ extern char datatoc_gpu_shader_uniform_color_frag_glsl[]; extern char datatoc_gpu_shader_checker_frag_glsl[]; extern char datatoc_gpu_shader_diag_stripes_frag_glsl[]; extern char datatoc_gpu_shader_simple_lighting_frag_glsl[]; -extern char datatoc_gpu_shader_simple_lighting_flat_color_frag_glsl[]; -extern char datatoc_gpu_shader_simple_lighting_smooth_color_frag_glsl[]; -extern char datatoc_gpu_shader_simple_lighting_smooth_color_alpha_frag_glsl[]; extern char datatoc_gpu_shader_flat_color_frag_glsl[]; extern char datatoc_gpu_shader_flat_color_alpha_test_0_frag_glsl[]; extern char datatoc_gpu_shader_flat_id_frag_glsl[]; @@ -67,7 +64,6 @@ extern char datatoc_gpu_shader_2D_flat_color_vert_glsl[]; extern char datatoc_gpu_shader_2D_smooth_color_uniform_alpha_vert_glsl[]; extern char datatoc_gpu_shader_2D_smooth_color_vert_glsl[]; extern char datatoc_gpu_shader_2D_smooth_color_frag_glsl[]; -extern char datatoc_gpu_shader_2D_smooth_color_dithered_frag_glsl[]; extern char datatoc_gpu_shader_2D_image_vert_glsl[]; extern char datatoc_gpu_shader_2D_image_rect_vert_glsl[]; extern char datatoc_gpu_shader_2D_image_multi_rect_vert_glsl[]; @@ -89,15 +85,10 @@ extern char datatoc_gpu_shader_image_alpha_color_frag_glsl[]; extern char datatoc_gpu_shader_image_shuffle_color_frag_glsl[]; extern char datatoc_gpu_shader_image_mask_uniform_color_frag_glsl[]; extern char datatoc_gpu_shader_image_modulate_alpha_frag_glsl[]; -extern char datatoc_gpu_shader_image_depth_linear_frag_glsl[]; -extern char datatoc_gpu_shader_image_depth_copy_frag_glsl[]; -extern char datatoc_gpu_shader_image_multisample_resolve_frag_glsl[]; extern char datatoc_gpu_shader_3D_vert_glsl[]; extern char datatoc_gpu_shader_3D_normal_vert_glsl[]; extern char datatoc_gpu_shader_3D_flat_color_vert_glsl[]; extern char datatoc_gpu_shader_3D_smooth_color_vert_glsl[]; -extern char datatoc_gpu_shader_3D_normal_flat_color_vert_glsl[]; -extern char datatoc_gpu_shader_3D_normal_smooth_color_vert_glsl[]; extern char datatoc_gpu_shader_3D_smooth_color_frag_glsl[]; extern char datatoc_gpu_shader_3D_passthrough_vert_glsl[]; extern char datatoc_gpu_shader_3D_clipped_uniform_color_vert_glsl[]; @@ -884,23 +875,6 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .vert = datatoc_gpu_shader_3D_normal_vert_glsl, .frag = datatoc_gpu_shader_simple_lighting_frag_glsl, }, - /* Use 'USE_FLAT_NORMAL' to make flat shader from smooth */ - [GPU_SHADER_SIMPLE_LIGHTING_FLAT_COLOR] = - { - .vert = datatoc_gpu_shader_3D_normal_smooth_color_vert_glsl, - .frag = datatoc_gpu_shader_simple_lighting_smooth_color_frag_glsl, - .defs = "#define USE_FLAT_NORMAL\n", - }, - [GPU_SHADER_SIMPLE_LIGHTING_SMOOTH_COLOR] = - { - .vert = datatoc_gpu_shader_3D_normal_smooth_color_vert_glsl, - .frag = datatoc_gpu_shader_simple_lighting_smooth_color_frag_glsl, - }, - [GPU_SHADER_SIMPLE_LIGHTING_SMOOTH_COLOR_ALPHA] = - { - .vert = datatoc_gpu_shader_3D_normal_smooth_color_vert_glsl, - .frag = datatoc_gpu_shader_simple_lighting_smooth_color_alpha_frag_glsl, - }, [GPU_SHADER_2D_IMAGE_MASK_UNIFORM_COLOR] = { @@ -912,69 +886,6 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .vert = datatoc_gpu_shader_3D_image_vert_glsl, .frag = datatoc_gpu_shader_image_modulate_alpha_frag_glsl, }, - [GPU_SHADER_3D_IMAGE_DEPTH] = - { - .vert = datatoc_gpu_shader_3D_image_vert_glsl, - .frag = datatoc_gpu_shader_image_depth_linear_frag_glsl, - }, - [GPU_SHADER_3D_IMAGE_DEPTH_COPY] = - { - .vert = datatoc_gpu_shader_3D_image_vert_glsl, - .frag = datatoc_gpu_shader_image_depth_copy_frag_glsl, - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_2] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 2\n", - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_4] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 4\n", - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_8] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 8\n", - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_16] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 16\n", - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_2_DEPTH_TEST] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 2\n" - "#define USE_DEPTH\n", - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_4_DEPTH_TEST] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 4\n" - "#define USE_DEPTH\n", - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_8_DEPTH_TEST] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 8\n" - "#define USE_DEPTH\n", - }, - [GPU_SHADER_2D_IMAGE_MULTISAMPLE_16_DEPTH_TEST] = - { - .vert = datatoc_gpu_shader_2D_vert_glsl, - .frag = datatoc_gpu_shader_image_multisample_resolve_frag_glsl, - .defs = "#define SAMPLES 16\n" - "#define USE_DEPTH\n", - }, - [GPU_SHADER_2D_CHECKER] = { .vert = datatoc_gpu_shader_2D_vert_glsl, @@ -1002,11 +913,6 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .vert = datatoc_gpu_shader_2D_smooth_color_vert_glsl, .frag = datatoc_gpu_shader_2D_smooth_color_frag_glsl, }, - [GPU_SHADER_2D_SMOOTH_COLOR_DITHER] = - { - .vert = datatoc_gpu_shader_2D_smooth_color_vert_glsl, - .frag = datatoc_gpu_shader_2D_smooth_color_dithered_frag_glsl, - }, [GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE] = { .vert = datatoc_gpu_shader_2D_image_vert_glsl, @@ -1058,12 +964,6 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .vert = datatoc_gpu_shader_3D_vert_glsl, .frag = datatoc_gpu_shader_uniform_color_frag_glsl, }, - [GPU_SHADER_3D_UNIFORM_COLOR_BACKGROUND] = - { - .vert = datatoc_gpu_shader_3D_vert_glsl, - .frag = datatoc_gpu_shader_uniform_color_frag_glsl, - .defs = "#define USE_BACKGROUND\n", - }, [GPU_SHADER_3D_FLAT_COLOR] = { .vert = datatoc_gpu_shader_3D_flat_color_vert_glsl, diff --git a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl deleted file mode 100644 index 181b1bf3fad..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl +++ /dev/null @@ -1,18 +0,0 @@ - -noperspective in vec4 finalColor; -out vec4 fragColor; - -/* 4x4 bayer matrix prepared for 8bit UNORM precision error. */ -#define P(x) (((x + 0.5) * (1.0 / 16.0) - 0.5) * (1.0 / 255.0)) -const vec4 dither_mat4x4[4] = vec4[4](vec4(P(0.0), P(8.0), P(2.0), P(10.0)), - vec4(P(12.0), P(4.0), P(14.0), P(6.0)), - vec4(P(3.0), P(11.0), P(1.0), P(9.0)), - vec4(P(15.0), P(7.0), P(13.0), P(5.0))); - -void main() -{ - ivec2 tx1 = ivec2(gl_FragCoord.xy) % 4; - ivec2 tx2 = ivec2(gl_FragCoord.xy) % 2; - float dither_noise = dither_mat4x4[tx1.x][tx1.y]; - fragColor = finalColor + dither_noise; -} diff --git a/source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl deleted file mode 100644 index 7fa571343a2..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl +++ /dev/null @@ -1,22 +0,0 @@ - -uniform mat4 ModelViewProjectionMatrix; -uniform mat3 NormalMatrix; - -in vec3 pos; -in vec3 nor; -in vec4 color; - -#ifdef USE_FLAT_NORMAL -flat out vec3 normal; -flat out vec4 finalColor; -#else -out vec3 normal; -out vec4 finalColor; -#endif - -void main() -{ - normal = normalize(NormalMatrix * nor); - gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); - finalColor = color; -} diff --git a/source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl deleted file mode 100644 index 0f2749362b9..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl +++ /dev/null @@ -1,12 +0,0 @@ - -in vec2 texCoord_interp; -out vec4 fragColor; - -uniform sampler2D image; - -void main() -{ - float depth = texture(image, texCoord_interp).r; - fragColor = vec4(depth); - gl_FragDepth = depth; -} diff --git a/source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl deleted file mode 100644 index 017b21076c8..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl +++ /dev/null @@ -1,16 +0,0 @@ - -in vec2 texCoord_interp; -out vec4 fragColor; - -uniform float znear; -uniform float zfar; -uniform sampler2D image; - -void main() -{ - float depth = texture(image, texCoord_interp).r; - - /* normalize */ - fragColor.rgb = vec3((2.0f * znear) / (zfar + znear - (depth * (zfar - znear)))); - fragColor.a = 1.0f; -} diff --git a/source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl deleted file mode 100644 index ca425374a1b..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl +++ /dev/null @@ -1,119 +0,0 @@ - -uniform sampler2DMS depthMulti; -uniform sampler2DMS colorMulti; - -out vec4 fragColor; - -#if SAMPLES > 16 -# error "Too many samples" -#endif - -void main() -{ - ivec2 texel = ivec2(gl_FragCoord.xy); - - bvec4 b1, b2, b3, b4; - vec4 w1, w2, w3, w4; - vec4 d1, d2, d3, d4; - vec4 c1, c2, c3, c4, c5, c6, c7, c8; - vec4 c9, c10, c11, c12, c13, c14, c15, c16; - d1 = d2 = d3 = d4 = vec4(0.5); - w1 = w2 = w3 = w4 = vec4(0.0); - c1 = c2 = c3 = c4 = c5 = c6 = c7 = c8 = vec4(0.0); - c9 = c10 = c11 = c12 = c13 = c14 = c15 = c16 = vec4(0.0); - -#ifdef USE_DEPTH - /* Depth */ - d1.x = texelFetch(depthMulti, texel, 0).r; - d1.y = texelFetch(depthMulti, texel, 1).r; -# if SAMPLES > 2 - d1.z = texelFetch(depthMulti, texel, 2).r; - d1.w = texelFetch(depthMulti, texel, 3).r; -# endif -# if SAMPLES > 4 - d2.x = texelFetch(depthMulti, texel, 4).r; - d2.y = texelFetch(depthMulti, texel, 5).r; - d2.z = texelFetch(depthMulti, texel, 6).r; - d2.w = texelFetch(depthMulti, texel, 7).r; -# endif -# if SAMPLES > 8 - d3.x = texelFetch(depthMulti, texel, 8).r; - d3.y = texelFetch(depthMulti, texel, 9).r; - d3.z = texelFetch(depthMulti, texel, 10).r; - d3.w = texelFetch(depthMulti, texel, 11).r; - d4.x = texelFetch(depthMulti, texel, 12).r; - d4.y = texelFetch(depthMulti, texel, 13).r; - d4.z = texelFetch(depthMulti, texel, 14).r; - d4.w = texelFetch(depthMulti, texel, 15).r; -# endif -#endif - - /* COLOR */ - b1 = notEqual(d1, vec4(1.0)); - if (any(b1)) { - c1 = texelFetch(colorMulti, texel, 0); - c2 = texelFetch(colorMulti, texel, 1); -#if SAMPLES > 2 - c3 = texelFetch(colorMulti, texel, 2); - c4 = texelFetch(colorMulti, texel, 3); -#endif - w1 = vec4(b1); - } -#if SAMPLES > 4 - b2 = notEqual(d2, vec4(1.0)); - if (any(b2)) { - c5 = texelFetch(colorMulti, texel, 4); - c6 = texelFetch(colorMulti, texel, 5); - c7 = texelFetch(colorMulti, texel, 6); - c8 = texelFetch(colorMulti, texel, 7); - w2 = vec4(b2); - } -#endif -#if SAMPLES > 8 - b3 = notEqual(d3, vec4(1.0)); - if (any(b3)) { - c9 = texelFetch(colorMulti, texel, 8); - c10 = texelFetch(colorMulti, texel, 9); - c11 = texelFetch(colorMulti, texel, 10); - c12 = texelFetch(colorMulti, texel, 11); - w3 = vec4(b3); - } - b4 = notEqual(d4, vec4(1.0)); - if (any(b4)) { - c13 = texelFetch(colorMulti, texel, 12); - c14 = texelFetch(colorMulti, texel, 13); - c15 = texelFetch(colorMulti, texel, 14); - c16 = texelFetch(colorMulti, texel, 15); - w4 = vec4(b4); - } -#endif - -#ifdef USE_DEPTH -# if SAMPLES > 8 - d1 = min(d1, min(d3, d4)); -# endif -# if SAMPLES > 4 - d1 = min(d1, d2); - d1 = min(d1, d2); -# endif -# if SAMPLES > 2 - d1.xy = min(d1.xy, d1.zw); -# endif - gl_FragDepth = min(d1.x, d1.y); -#endif - - c1 = c1 + c2; -#if SAMPLES > 2 - c1 += c3 + c4; -#endif -#if SAMPLES > 4 - c1 += c5 + c6 + c7 + c8; -#endif -#if SAMPLES > 8 - c1 += c9 + c10 + c11 + c12 + c13 + c14 + c15 + c16; -#endif - - const float inv_samples = 1.0 / float(SAMPLES); - - fragColor = c1 * inv_samples; -} diff --git a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl b/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl deleted file mode 100644 index 2ed99be2bcf..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl +++ /dev/null @@ -1,14 +0,0 @@ - -uniform vec3 light; -uniform float alpha; -uniform float global; - -in vec3 normal; -in vec4 finalColor; -out vec4 fragColor; - -void main() -{ - fragColor = finalColor * (global + (1.0 - global) * max(0.0, dot(normalize(normal), light))); - fragColor.a = alpha; -} diff --git a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl deleted file mode 100644 index 738b0d84e51..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl +++ /dev/null @@ -1,16 +0,0 @@ - -uniform vec3 light; - -#ifdef USE_FLAT_NORMAL -flat in vec3 normal; -flat in vec4 finalColor; -#else -in vec3 normal; -in vec4 finalColor; -#endif -out vec4 fragColor; - -void main() -{ - fragColor = finalColor * max(0.0, dot(normalize(normal), light)); -} diff --git a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl index cfa82572e87..d9f84964eb4 100644 --- a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl @@ -17,8 +17,4 @@ void main() #else fragColor = color; #endif - -#if defined(USE_BACKGROUND) - gl_FragDepth = 1.0; -#endif } -- cgit v1.2.3