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-06-03 17:13:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-06-03 17:14:05 +0300
commit95f5272bda9e2824bb5e5ee8fd525029331eb5f5 (patch)
tree7ed4fdca7cee8e13d259f61b6934fe57b9d8fee0 /source/blender/draw/engines/gpencil
parent7b28a31f2c3a6bd28b465f6a48d9ee064ecb5176 (diff)
Cleanup: style, use braces in draw
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl3
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl27
2 files changed, 20 insertions, 10 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl
index a5580e305d6..7d0ebe88aa4 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_frag.glsl
@@ -104,6 +104,7 @@ void main()
}
*/
- if (fragColor.a < 0.0035)
+ if (fragColor.a < 0.0035) {
discard;
+ }
}
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
index 9ea96806481..3300514dd13 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
@@ -78,18 +78,23 @@ void main(void)
/* culling outside viewport */
vec2 area = Viewport * 4.0;
- if (sp1.x < -area.x || sp1.x > area.x)
+ if (sp1.x < -area.x || sp1.x > area.x) {
return;
- if (sp1.y < -area.y || sp1.y > area.y)
+ }
+ if (sp1.y < -area.y || sp1.y > area.y) {
return;
- if (sp2.x < -area.x || sp2.x > area.x)
+ }
+ if (sp2.x < -area.x || sp2.x > area.x) {
return;
- if (sp2.y < -area.y || sp2.y > area.y)
+ }
+ if (sp2.y < -area.y || sp2.y > area.y) {
return;
+ }
/* culling behind camera */
- if (P1.w < 0 || P2.w < 0)
+ if (P1.w < 0 || P2.w < 0) {
return;
+ }
/* determine the direction of each of the 3 segments (previous, current, next) */
vec2 v0 = normalize(sp1 - sp0);
@@ -108,16 +113,20 @@ void main(void)
/* determine the length of the miter by projecting it onto normal and then inverse it */
float an1 = dot(miter_a, n1);
float bn1 = dot(miter_b, n2);
- if (an1 == 0)
+ if (an1 == 0) {
an1 = 1;
- if (bn1 == 0)
+ }
+ if (bn1 == 0) {
bn1 = 1;
+ }
float length_a = finalThickness[1] / an1;
float length_b = finalThickness[2] / bn1;
- if (length_a <= 0.0)
+ if (length_a <= 0.0) {
length_a = 0.01;
- if (length_b <= 0.0)
+ }
+ if (length_b <= 0.0) {
length_b = 0.01;
+ }
/* prevent excessively long miters at sharp corners */
if (dot(v0, v1) < -MiterLimit) {