diff options
author | Jaime van Kessel <nallath@gmail.com> | 2017-06-15 22:17:21 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2017-06-15 22:17:21 +0300 |
commit | 856a490accb9e06151791c59490528fb5c1ab488 (patch) | |
tree | 722eafd7bb4a4b4dcb700e8e1704ed607620c438 /plugins/XRayView | |
parent | c93acc12e7b828d2b21bc9d89d688324e7429ff1 (diff) |
Removed unneeded shader duplication.
The work done for USL-43 ensures that all this duplication is no longer needed.
Diffstat (limited to 'plugins/XRayView')
-rw-r--r-- | plugins/XRayView/xray_composite.shader | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/plugins/XRayView/xray_composite.shader b/plugins/XRayView/xray_composite.shader index 82dca52cf9..e7a38950bf 100644 --- a/plugins/XRayView/xray_composite.shader +++ b/plugins/XRayView/xray_composite.shader @@ -67,77 +67,6 @@ fragment = } } -vertex41core = - #version 410 - uniform highp mat4 u_modelViewProjectionMatrix; - in highp vec4 a_vertex; - in highp vec2 a_uvs; - - out highp vec2 v_uvs; - - void main() - { - gl_Position = u_modelViewProjectionMatrix * a_vertex; - v_uvs = a_uvs; - } - -fragment41core = - #version 410 - uniform sampler2D u_layer0; - uniform sampler2D u_layer1; - uniform sampler2D u_layer2; - - uniform vec2 u_offset[9]; - - uniform float u_outline_strength; - uniform vec4 u_outline_color; - uniform vec4 u_error_color; - uniform vec4 u_background_color; - - const vec3 x_axis = vec3(1.0, 0.0, 0.0); - const vec3 y_axis = vec3(0.0, 1.0, 0.0); - const vec3 z_axis = vec3(0.0, 0.0, 1.0); - - in vec2 v_uvs; - out vec4 frag_color; - - float kernel[9]; - - void main() - { - kernel[0] = 0.0; kernel[1] = 1.0; kernel[2] = 0.0; - kernel[3] = 1.0; kernel[4] = -4.0; kernel[5] = 1.0; - kernel[6] = 0.0; kernel[7] = 1.0; kernel[8] = 0.0; - - vec4 result = u_background_color; - vec4 layer0 = texture(u_layer0, v_uvs); - - result = layer0 * layer0.a + result * (1.0 - layer0.a); - - float intersection_count = (texture(u_layer2, v_uvs).r * 255.0) / 5.0; - if(mod(intersection_count, 2.0) == 1.0) - { - result = u_error_color; - } - - vec4 sum = vec4(0.0); - for (int i = 0; i < 9; i++) - { - vec4 color = vec4(texture(u_layer1, v_uvs.xy + u_offset[i]).a); - sum += color * (kernel[i] / u_outline_strength); - } - - vec4 layer1 = texture(u_layer1, v_uvs); - if((layer1.rgb == x_axis || layer1.rgb == y_axis || layer1.rgb == z_axis)) - { - frag_color = result; - } - else - { - frag_color = mix(result, vec4(abs(sum.a)) * u_outline_color, abs(sum.a)); - } - } - [defaults] u_layer0 = 0 u_layer1 = 1 |