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:
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl66
1 files changed, 34 insertions, 32 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl
index 7deca544176..92c9acf1f2a 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl
@@ -1,7 +1,7 @@
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ProjectionMatrix;
-uniform float pixsize; /* rv3d->pixsize */
+uniform float pixsize; /* rv3d->pixsize */
uniform int keep_size;
uniform float objscale;
uniform float pixfactor;
@@ -22,42 +22,44 @@ out vec4 finalprev_pos;
#define TRUE 1
-#define OB_WIRE 2
+#define OB_WIRE 2
#define OB_SOLID 3
-#define V3D_SHADING_MATERIAL_COLOR 0
-#define V3D_SHADING_TEXTURE_COLOR 3
+#define V3D_SHADING_MATERIAL_COLOR 0
+#define V3D_SHADING_TEXTURE_COLOR 3
float defaultpixsize = pixsize * (1000.0 / pixfactor);
void main()
{
- gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
- finalprev_pos = ModelViewProjectionMatrix * vec4(prev_pos, 1.0);
- finalColor = color;
-
- if (keep_size == TRUE) {
- finalThickness = thickness;
- }
- else {
- float size = (ProjectionMatrix[3][3] == 0.0) ? (thickness / (gl_Position.z * defaultpixsize)) : (thickness / defaultpixsize);
- finalThickness = max(size * objscale, 4.0); /* minimum 4 pixels */
- }
-
- /* for wireframe override size and color */
- if (shading_type[0] == OB_WIRE) {
- finalThickness = 2.0;
- finalColor = wire_color;
- }
- /* for solid override color */
- if (shading_type[0] == OB_SOLID) {
- if ((shading_type[1] != V3D_SHADING_MATERIAL_COLOR) && (shading_type[1] != V3D_SHADING_TEXTURE_COLOR)) {
- finalColor = wire_color;
- }
- if (viewport_xray == 1) {
- finalColor.a *= 0.5;
- }
- }
-
- finaluvdata = uvdata;
+ gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
+ finalprev_pos = ModelViewProjectionMatrix * vec4(prev_pos, 1.0);
+ finalColor = color;
+
+ if (keep_size == TRUE) {
+ finalThickness = thickness;
+ }
+ else {
+ float size = (ProjectionMatrix[3][3] == 0.0) ? (thickness / (gl_Position.z * defaultpixsize)) :
+ (thickness / defaultpixsize);
+ finalThickness = max(size * objscale, 4.0); /* minimum 4 pixels */
+ }
+
+ /* for wireframe override size and color */
+ if (shading_type[0] == OB_WIRE) {
+ finalThickness = 2.0;
+ finalColor = wire_color;
+ }
+ /* for solid override color */
+ if (shading_type[0] == OB_SOLID) {
+ if ((shading_type[1] != V3D_SHADING_MATERIAL_COLOR) &&
+ (shading_type[1] != V3D_SHADING_TEXTURE_COLOR)) {
+ finalColor = wire_color;
+ }
+ if (viewport_xray == 1) {
+ finalColor.a *= 0.5;
+ }
+ }
+
+ finaluvdata = uvdata;
}