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-06 18:49:05 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-07 02:19:14 +0300
commitfac2cfdfa776e0829c4d89b28392b1404edda5d6 (patch)
tree038cb7b0398ace858cdccb6a9b2917267c5067de /source/blender/draw/engines/eevee/eevee_materials.c
parent8a204ccdb49bd682e41a5d706726c3c77f6217fd (diff)
Eevee: Improve Hashed Alpha transparency by reducing noise size
This only affect renders and static viewport accumulation. It reduces helps reduce noise when lots of half transparent surfaces overlaps.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_materials.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index eee1e716da1..212f89e7216 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -71,6 +71,7 @@ static struct {
uint sss_count;
float alpha_hash_offset;
+ float alpha_hash_scale;
float noise_offsets[3];
} e_data = {NULL}; /* Engine data */
@@ -635,11 +636,13 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, E
((stl->effects->enabled_effects & EFFECT_TAA) == 0))
{
e_data.alpha_hash_offset = 0.0f;
+ e_data.alpha_hash_scale = 1.0f;
}
else {
double r;
BLI_halton_1D(5, 0.0, stl->effects->taa_current_sample - 1, &r);
e_data.alpha_hash_offset = (float)r;
+ e_data.alpha_hash_scale = 0.01f;
}
{
@@ -1206,6 +1209,8 @@ static void material_opaque(
else if (ma->blend_method == MA_BM_HASHED) {
DRW_shgroup_uniform_float(*shgrp_depth, "hashAlphaOffset", &e_data.alpha_hash_offset, 1);
DRW_shgroup_uniform_float(*shgrp_depth_clip, "hashAlphaOffset", &e_data.alpha_hash_offset, 1);
+ DRW_shgroup_uniform_float_copy(*shgrp_depth, "hashAlphaScale", e_data.alpha_hash_scale);
+ DRW_shgroup_uniform_float_copy(*shgrp_depth_clip, "hashAlphaScale", e_data.alpha_hash_scale);
}
}
}