Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorGermano <germano.costa@ig.com.br>2018-04-30 22:55:16 +0300
committerGermano <germano.costa@ig.com.br>2018-04-30 22:55:16 +0300
commit7770d38303183af93dea9e5212751a137c991df6 (patch)
tree117956b24e967b9a67eb8ef124ce5f4d78fdf7e8 /source
parentaaf85e29a19026df22e235f2cde2a716e20f5b02 (diff)
Cleanup: simplify GLSL logic in outlines drawing.
No functional changes.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/modes/shaders/object_outline_detect_frag.glsl7
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);