diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/draw/modes/shaders/animviz_mpath_lines_geom.glsl | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/draw/modes/shaders/animviz_mpath_lines_geom.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/animviz_mpath_lines_geom.glsl | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/source/blender/draw/modes/shaders/animviz_mpath_lines_geom.glsl b/source/blender/draw/modes/shaders/animviz_mpath_lines_geom.glsl index d9d59880e99..b81f9f639ca 100644 --- a/source/blender/draw/modes/shaders/animviz_mpath_lines_geom.glsl +++ b/source/blender/draw/modes/shaders/animviz_mpath_lines_geom.glsl @@ -13,26 +13,30 @@ out vec4 finalColor; vec2 compute_dir(vec2 v0, vec2 v1) { - vec2 dir = normalize(v1 - v0 + 1e-8); - dir = vec2(-dir.y, dir.x); - return dir; + vec2 dir = normalize(v1 - v0 + 1e-8); + dir = vec2(-dir.y, dir.x); + return dir; } void main(void) { - vec2 t; - vec2 edge_dir = compute_dir(ssPos[0], ssPos[1]) / viewportSize; - - bool is_persp = (ProjectionMatrix[3][3] == 0.0); - - finalColor = finalColor_geom[0]; - t = edge_dir * (float(lineThickness) * (is_persp ? gl_in[0].gl_Position.w : 1.0)); - gl_Position = gl_in[0].gl_Position + vec4(t, 0.0, 0.0); EmitVertex(); - gl_Position = gl_in[0].gl_Position - vec4(t, 0.0, 0.0); EmitVertex(); - - finalColor = finalColor_geom[1]; - t = edge_dir * (float(lineThickness) * (is_persp ? gl_in[1].gl_Position.w : 1.0)); - gl_Position = gl_in[1].gl_Position + vec4(t, 0.0, 0.0); EmitVertex(); - gl_Position = gl_in[1].gl_Position - vec4(t, 0.0, 0.0); EmitVertex(); - EndPrimitive(); + vec2 t; + vec2 edge_dir = compute_dir(ssPos[0], ssPos[1]) / viewportSize; + + bool is_persp = (ProjectionMatrix[3][3] == 0.0); + + finalColor = finalColor_geom[0]; + t = edge_dir * (float(lineThickness) * (is_persp ? gl_in[0].gl_Position.w : 1.0)); + gl_Position = gl_in[0].gl_Position + vec4(t, 0.0, 0.0); + EmitVertex(); + gl_Position = gl_in[0].gl_Position - vec4(t, 0.0, 0.0); + EmitVertex(); + + finalColor = finalColor_geom[1]; + t = edge_dir * (float(lineThickness) * (is_persp ? gl_in[1].gl_Position.w : 1.0)); + gl_Position = gl_in[1].gl_Position + vec4(t, 0.0, 0.0); + EmitVertex(); + gl_Position = gl_in[1].gl_Position - vec4(t, 0.0, 0.0); + EmitVertex(); + EndPrimitive(); } |