[Bf-blender-cvs] [b95c52d1510] greasepencil-object: GPencil: Text flip vertical to texture stroke
Antonioya
noreply at git.blender.org
Wed Mar 13 19:48:22 CET 2019
Commit: b95c52d15101dab8dbd12680c82c88f5d8795da2
Author: Antonioya
Date: Wed Mar 13 19:48:16 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBb95c52d15101dab8dbd12680c82c88f5d8795da2
GPencil: Text flip vertical to texture stroke
===================================================================
M source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
===================================================================
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 4ab7ef7be09..a5b5e07a494 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
@@ -192,33 +192,38 @@ void main(void)
uv_x2 = uv_x2 - d;
}
+ float y_a = 0.0;
+ float y_b = 1.0;
+
/* invert uv */
if ((finaluvdata[1].y != 0.0) && (finaluvdata[2].y != 0.0)) {
if (floor(d / 2.0) == (d / 2.0)) {
- float t = uv_x2;
- uv_x2 = uv_x1;
- uv_x1 = t;
+ // float t = uv_x2;
+ // uv_x2 = uv_x1;
+ // uv_x1 = t;
+ y_a = 1.0;
+ y_b = 0.0;
}
}
/* generate the triangle strip */
uvfac = vec2(0.0, 0.0);
- mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(0, 0) : vec2(uv_x1, 0);
+ mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(0, 0) : vec2(uv_x1, y_a);
mColor = finalColor[1];
gl_Position = vec4((sp1 + length_a * miter_a) / Viewport, getZdepth(P1), 1.0);
EmitVertex();
- mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(0, 1) : vec2(uv_x1, 1);
+ mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(0, 1) : vec2(uv_x1, y_b);
mColor = finalColor[1];
gl_Position = vec4((sp1 - length_a * miter_a) / Viewport, getZdepth(P1), 1.0);
EmitVertex();
- mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(1, 0) : vec2(uv_x2, 0);
+ mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(1, 0) : vec2(uv_x2, y_a);
mColor = finalColor[2];
gl_Position = vec4((sp2 + length_b * miter_b) / Viewport, getZdepth(P2), 1.0);
EmitVertex();
- mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(1, 1) : vec2(uv_x2, 1);
+ mTexCoord = (color_type == GPENCIL_COLOR_SOLID) ? vec2(1, 1) : vec2(uv_x2, y_b);
mColor = finalColor[2];
gl_Position = vec4((sp2 - length_b * miter_b) / Viewport, getZdepth(P2), 1.0);
EmitVertex();
More information about the Bf-blender-cvs
mailing list