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 <jbakker>2019-10-16 16:30:57 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-10-16 16:40:25 +0300
commitb0476f06312db95423e6b83a86d7675dbbc94431 (patch)
treee9a027f239b3bbab9d2f3153a8f7f1aedd81427f /source/blender/draw/engines/workbench/shaders
parent80f0bc99a9831709338fdb252546829afdf4912a (diff)
Workbench: Background Dithering
Background dithering was introduced to solve banding issues on gradient backgrounds. This patch will enable dithering based on the texture that is used for drawing. Only when using a GPU_RGBA8 texture the dithering will be enabled. This disables dithering for final rendering, vertex and texture paint modes. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6056
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders')
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_background_lib.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl3
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_background_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_background_lib.glsl
index a6d7c4b393b..3ac220aee59 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_background_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_background_lib.glsl
@@ -1,5 +1,5 @@
vec3 background_color(WorldData world_data, float y)
{
return mix(world_data.background_color_low, world_data.background_color_high, y).xyz +
- bayer_dither_noise();
+ (world_data.background_dither_factor * bayer_dither_noise());
}
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
index 16df56b393a..f60eca24821 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
@@ -16,5 +16,6 @@ struct WorldData {
float background_alpha;
float curvature_ridge;
float curvature_valley;
- int pad[3];
+ float background_dither_factor;
+ int pad[2];
};