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/modes/shaders')
-rw-r--r--source/blender/draw/modes/shaders/common_globals_lib.glsl2
-rw-r--r--source/blender/draw/modes/shaders/common_hair_lib.glsl6
-rw-r--r--source/blender/draw/modes/shaders/paint_vertex_frag.glsl9
-rw-r--r--source/blender/draw/modes/shaders/paint_weight_frag.glsl5
4 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/draw/modes/shaders/common_globals_lib.glsl b/source/blender/draw/modes/shaders/common_globals_lib.glsl
index 3cc6ac9a5a4..f75ef06b6d9 100644
--- a/source/blender/draw/modes/shaders/common_globals_lib.glsl
+++ b/source/blender/draw/modes/shaders/common_globals_lib.glsl
@@ -83,7 +83,7 @@ layout(std140) uniform globalsBlock
float pad_globalsBlock;
};
-/* data[0] (1nd byte flags) */
+/* data[0] (1st byte flags) */
#define FACE_ACTIVE (1 << 0)
#define FACE_SELECTED (1 << 1)
#define FACE_FREESTYLE (1 << 2)
diff --git a/source/blender/draw/modes/shaders/common_hair_lib.glsl b/source/blender/draw/modes/shaders/common_hair_lib.glsl
index f9c3df34658..cbcdc947bc7 100644
--- a/source/blender/draw/modes/shaders/common_hair_lib.glsl
+++ b/source/blender/draw/modes/shaders/common_hair_lib.glsl
@@ -1,8 +1,8 @@
/**
* Library to create hairs dynamically from control points.
* This is less bandwidth intensive than fetching the vertex attributes
- * but does more ALU work per vertex. This also reduce the number
- * of data the CPU has to precompute and transfert for each update.
+ * but does more ALU work per vertex. This also reduces the amount
+ * of data the CPU has to precompute and transfer for each update.
*/
/**
@@ -44,7 +44,7 @@ uniform usamplerBuffer hairStrandSegBuffer; /* R16UI */
/* -- Subdivision stage -- */
/**
* We use a transform feedback to preprocess the strands and add more subdivision to it.
- * For the moment theses are simple smooth interpolation but one could hope to see the full
+ * For the moment these are simple smooth interpolation but one could hope to see the full
* children particle modifiers being evaluated at this stage.
*
* If no more subdivision is needed, we can skip this step.
diff --git a/source/blender/draw/modes/shaders/paint_vertex_frag.glsl b/source/blender/draw/modes/shaders/paint_vertex_frag.glsl
index 426dbada812..f03e3410ec3 100644
--- a/source/blender/draw/modes/shaders/paint_vertex_frag.glsl
+++ b/source/blender/draw/modes/shaders/paint_vertex_frag.glsl
@@ -2,7 +2,7 @@
in vec3 finalColor;
out vec4 fragColor;
-uniform float white_factor = 1.0;
+uniform float opacity = 1.0;
vec3 linear_to_srgb_attr(vec3 c)
{
@@ -14,6 +14,11 @@ vec3 linear_to_srgb_attr(vec3 c)
void main()
{
- fragColor.rgb = mix(linear_to_srgb_attr(finalColor), vec3(1.0), white_factor);
+ vec3 color = linear_to_srgb_attr(finalColor);
+#ifdef DRW_STATE_BLEND_ALPHA
+ fragColor = vec4(color, opacity);
+#else
+ fragColor.rgb = mix(vec3(1.0), color, opacity);
fragColor.a = 1.0;
+#endif
}
diff --git a/source/blender/draw/modes/shaders/paint_weight_frag.glsl b/source/blender/draw/modes/shaders/paint_weight_frag.glsl
index 8b0e03ac31c..76b7719be64 100644
--- a/source/blender/draw/modes/shaders/paint_weight_frag.glsl
+++ b/source/blender/draw/modes/shaders/paint_weight_frag.glsl
@@ -95,6 +95,11 @@ void main()
color = mix(weight_color, colorVertexUnreferenced, alert * alert);
}
+#ifdef DRW_STATE_BLEND_ALPHA
+ /* alpha blending mix */
+ fragColor = vec4(color.rgb, opacity);
+#else
/* mix with 1.0 -> is like opacity when using multiply blend mode */
fragColor = vec4(mix(vec3(1.0), color.rgb, opacity), 1.0);
+#endif
}