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:
authorClément Foucault <foucault.clem@gmail.com>2018-11-07 02:17:36 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-07 02:19:14 +0300
commitb23c68a93730ee77d69cfacc305a01206b9d86cb (patch)
tree2f1eb1a5ec254a433128badff583c3bdc5959777 /source/blender/draw/engines/workbench/shaders
parent8af53dbeab8ad692c1a0b4d82b6ac955f0b94a45 (diff)
Workbench: Improve volume render by removing noise using temporal AA
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders')
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
index d2a4c49f7de..023ebb8e111 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
@@ -14,6 +14,7 @@ uniform sampler1D flameColorTexture;
uniform sampler1D transferTexture;
uniform int samplesLen = 256;
+uniform float noiseOfs = 0.0f;
uniform float stepLength; /* Step length in local space. */
uniform float densityScale; /* Simple Opacity multiplicator. */
uniform vec4 viewvecs[3];
@@ -115,7 +116,7 @@ vec4 volume_integration(
float final_transmittance = 1.0;
ivec2 tx = ivec2(gl_FragCoord.xy) % 4;
- float noise = dither_mat[tx.x][tx.y];
+ float noise = fract(dither_mat[tx.x][tx.y] + noiseOfs);
float ray_len = noise * ray_inc;
for (int i = 0; i < samplesLen && ray_len < ray_max; ++i, ray_len += ray_inc) {