diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-08 15:07:22 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-08 21:20:40 +0300 |
commit | 1250ace641814098ed8e6715f6e69c5cbd46f8dd (patch) | |
tree | a921f3eaae6c3682f6334584899ba89ce53e9233 /source/blender/draw/engines/eevee/eevee_materials.c | |
parent | de8c2336adf56061c4ae29c28cfc001d08d300f2 (diff) |
Eevee: Fix refraction materials
Fix refraction depth not working without ScreenSpace Refraction.
Fix ScreenSpace Refraction masking reflections.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 212f89e7216..78d5231a793 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -407,10 +407,11 @@ static void add_standard_uniforms( DRW_shgroup_uniform_texture_ref(shgrp, "probePlanars", &vedata->txl->planar_pool); DRW_shgroup_uniform_int(shgrp, "outputSsrId", ssr_id, 1); } - if (use_refract && use_ssrefraction) { - BLI_assert(refract_depth != NULL); - DRW_shgroup_uniform_float(shgrp, "refractionDepth", refract_depth, 1); - DRW_shgroup_uniform_texture_ref(shgrp, "colorBuffer", &vedata->txl->refract_color); + if (use_refract) { + DRW_shgroup_uniform_float_copy(shgrp, "refractionDepth", (refract_depth) ? *refract_depth : 0.0 ); + if (use_ssrefraction) { + DRW_shgroup_uniform_texture_ref(shgrp, "colorBuffer", &vedata->txl->refract_color); + } } if ((vedata->stl->effects->enabled_effects & EFFECT_VOLUMETRIC) != 0 && |