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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/draw/modes/shaders/object_outline_prepass_geom.glsl
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (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/object_outline_prepass_geom.glsl')
-rw-r--r--source/blender/draw/modes/shaders/object_outline_prepass_geom.glsl52
1 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/draw/modes/shaders/object_outline_prepass_geom.glsl b/source/blender/draw/modes/shaders/object_outline_prepass_geom.glsl
index 36999267ef2..97d4bdacf07 100644
--- a/source/blender/draw/modes/shaders/object_outline_prepass_geom.glsl
+++ b/source/blender/draw/modes/shaders/object_outline_prepass_geom.glsl
@@ -9,45 +9,45 @@ in vec3 vPos[];
void vert_from_gl_in(int v)
{
- gl_Position = pPos[v];
+ gl_Position = pPos[v];
#ifdef USE_WORLD_CLIP_PLANES
- world_clip_planes_set_clip_distance(gl_in[v].gl_ClipDistance);
+ world_clip_planes_set_clip_distance(gl_in[v].gl_ClipDistance);
#endif
}
void main()
{
- bool is_persp = (ProjectionMatrix[3][3] == 0.0);
+ bool is_persp = (ProjectionMatrix[3][3] == 0.0);
- vec3 view_vec = (is_persp) ? normalize(vPos[1]) : vec3(0.0, 0.0, -1.0);
+ vec3 view_vec = (is_persp) ? normalize(vPos[1]) : vec3(0.0, 0.0, -1.0);
- vec3 v10 = vPos[0] - vPos[1];
- vec3 v12 = vPos[2] - vPos[1];
- vec3 v13 = vPos[3] - vPos[1];
+ vec3 v10 = vPos[0] - vPos[1];
+ vec3 v12 = vPos[2] - vPos[1];
+ vec3 v13 = vPos[3] - vPos[1];
- vec3 n0 = cross(v12, v10);
- vec3 n3 = cross(v13, v12);
+ vec3 n0 = cross(v12, v10);
+ vec3 n3 = cross(v13, v12);
- float fac0 = dot(view_vec, n0);
- float fac3 = dot(view_vec, n3);
+ float fac0 = dot(view_vec, n0);
+ float fac3 = dot(view_vec, n3);
- /* If both adjacent verts are facing the camera the same way,
- * then it isn't an outline edge. */
- if (sign(fac0) == sign(fac3)) {
- return;
- }
+ /* If both adjacent verts are facing the camera the same way,
+ * then it isn't an outline edge. */
+ if (sign(fac0) == sign(fac3)) {
+ return;
+ }
- /* Don't outline if concave edge. */
- /* That would hide a lot of non useful edge but it flickers badly.
- * TODO revisit later... */
- // if (dot(n0, v13) > 0.01)
- // return;
+ /* Don't outline if concave edge. */
+ /* That would hide a lot of non useful edge but it flickers badly.
+ * TODO revisit later... */
+ // if (dot(n0, v13) > 0.01)
+ // return;
- vert_from_gl_in(1);
- EmitVertex();
+ vert_from_gl_in(1);
+ EmitVertex();
- vert_from_gl_in(2);
- EmitVertex();
+ vert_from_gl_in(2);
+ EmitVertex();
- EndPrimitive();
+ EndPrimitive();
}