[Bf-blender-cvs] [7770d383031] blender2.8: Cleanup: simplify GLSL logic in outlines drawing.

Germano noreply at git.blender.org
Mon Apr 30 21:55:27 CEST 2018


Commit: 7770d38303183af93dea9e5212751a137c991df6
Author: Germano
Date:   Mon Apr 30 16:55:16 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB7770d38303183af93dea9e5212751a137c991df6

Cleanup: simplify GLSL logic in outlines drawing.

No functional changes.

===================================================================

M	source/blender/draw/modes/shaders/object_outline_detect_frag.glsl

===================================================================

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);



More information about the Bf-blender-cvs mailing list