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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-06-22 11:37:38 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-06-22 11:43:03 +0300
commitf3501a00e249bc4a7212be1f443704066dd43482 (patch)
treeb6c1c39d2a623022ae8f38d5cdb62a61202339b7 /source/blender/draw/modes/shaders
parentc517778a8bf9a0fc8a60541528cbfaf3ec47c679 (diff)
PaintMode: Full Shading Boolean => Slider
There was a Full Shading bool that was shared across the WP, VP and TP modes. This commit makes some changes: - Replace the bool with a factor. This gives the user more control on the visibility. - Also draw it on top of the Material and Rendered mode so the user can control what he needs. In certain cases you don't want to see the final rendered material, but the actual texture. - Removed the skipping of objects when in paint modes. As now the paint modes are blended.
Diffstat (limited to 'source/blender/draw/modes/shaders')
-rw-r--r--source/blender/draw/modes/shaders/paint_texture_frag.glsl4
-rw-r--r--source/blender/draw/modes/shaders/paint_vertex_frag.glsl4
-rw-r--r--source/blender/draw/modes/shaders/paint_wire_frag.glsl4
3 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/draw/modes/shaders/paint_texture_frag.glsl b/source/blender/draw/modes/shaders/paint_texture_frag.glsl
index 18c58a54dca..4305e20ce7b 100644
--- a/source/blender/draw/modes/shaders/paint_texture_frag.glsl
+++ b/source/blender/draw/modes/shaders/paint_texture_frag.glsl
@@ -3,9 +3,9 @@ in vec2 uv_interp;
out vec4 fragColor;
uniform sampler2D image;
-
+uniform float alpha = 1.0;
void main()
{
- fragColor = texture(image, uv_interp);
+ fragColor = vec4(texture(image, uv_interp).rgb, alpha);
}
diff --git a/source/blender/draw/modes/shaders/paint_vertex_frag.glsl b/source/blender/draw/modes/shaders/paint_vertex_frag.glsl
index 5a00fec9c43..2c968dafa69 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 alpha = 1.0;
vec3 linear_to_srgb_attrib(vec3 c) {
c = max(c, vec3(0.0));
vec3 c1 = c * 12.92;
@@ -13,5 +13,5 @@ vec3 linear_to_srgb_attrib(vec3 c) {
void main()
{
fragColor.rgb = linear_to_srgb_attrib(finalColor);
- fragColor.a = 1.0;
+ fragColor.a = alpha;
}
diff --git a/source/blender/draw/modes/shaders/paint_wire_frag.glsl b/source/blender/draw/modes/shaders/paint_wire_frag.glsl
index e4214a4c6d1..b6637fea308 100644
--- a/source/blender/draw/modes/shaders/paint_wire_frag.glsl
+++ b/source/blender/draw/modes/shaders/paint_wire_frag.glsl
@@ -18,7 +18,5 @@ void main()
const vec4 colSel = vec4(1.0, 1.0, 1.0, 1.0);
#endif
- const vec4 colUnsel = vec4(0.5, 0.5, 0.5, 1.0);
-
- fragColor = bool(finalFlag & VERTEX_SELECTED) ? colSel : colUnsel;
+ fragColor = bool(finalFlag & VERTEX_SELECTED) ? colSel : colorWire;
}