diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-05-05 17:30:34 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-05-05 19:40:20 +0300 |
commit | 95889fe071e179a9a7d7e6a27aaf7a4a42fc49b8 (patch) | |
tree | a60ad25ce37258866f8c3e6f2ac86964320062fc /source | |
parent | a7b7f67fc4ad0a5bf4ffc2a64467b55479f4fd95 (diff) |
Fix T86823 Eevee: refraction depth shared between different materials
This was caused by the material grouping system which was missing
a per material uniform update in the opaque case.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 5 |
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 45c6900fc0f..a4325675ea9 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -623,6 +623,11 @@ static EeveeMaterialCache material_opaque(EEVEE_Data *vedata, /* This GPUShader has already been used by another material. * Add new shading group just after to avoid shader switching cost. */ grp = DRW_shgroup_create_sub(*grp_p); + + /* Per material uniforms. */ + if (use_ssrefract) { + DRW_shgroup_uniform_float_copy(grp, "refractionDepth", ma->refract_depth); + } } else { *grp_p = grp = DRW_shgroup_create(sh, shading_pass); |