diff options
author | Germano <germano.costa@ig.com.br> | 2018-04-30 22:55:16 +0300 |
---|---|---|
committer | Germano <germano.costa@ig.com.br> | 2018-04-30 22:55:16 +0300 |
commit | 7770d38303183af93dea9e5212751a137c991df6 (patch) | |
tree | 117956b24e967b9a67eb8ef124ce5f4d78fdf7e8 | |
parent | aaf85e29a19026df22e235f2cde2a716e20f5b02 (diff) |
Cleanup: simplify GLSL logic in outlines drawing.
No functional changes.
-rw-r--r-- | source/blender/draw/modes/shaders/object_outline_detect_frag.glsl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/draw/modes/shaders/object_outline_detect_frag.glsl b/source/blender/draw/modes/shaders/object_outline_detect_frag.glsl index 771b6bcdc2e..554328aa9ea 100644 --- a/source/blender/draw/modes/shaders/object_outline_detect_frag.glsl +++ b/source/blender/draw/modes/shaders/object_outline_detect_frag.glsl @@ -40,12 +40,11 @@ void main() #ifdef GL_ARB_texture_gather vec2 texel_size = 1.0 / vec2(textureSize(outlineId, 0).xy); - vec2 uv1 = ceil(gl_FragCoord.xy) * texel_size - texel_size; - vec2 uv2 = ceil(gl_FragCoord.xy) * texel_size; + vec2 uv = ceil(gl_FragCoord.xy) * texel_size; /* Samples order is CW starting from top left. */ - uvec4 tmp1 = textureGather(outlineId, uv1); - uvec4 tmp2 = textureGather(outlineId, uv2); + uvec4 tmp1 = textureGather(outlineId, uv - texel_size); + uvec4 tmp2 = textureGather(outlineId, uv); uint ref_id = tmp1.y; uvec4 id = uvec4(tmp1.xz, tmp2.xz); |