From bc3fdc329378128dc4253681f869e01d924da213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 10 Oct 2024 16:25:59 +0200 Subject: [PATCH] Fix: EEVEE: Object wihtout volume probe visibility don't cast shadow Object without lightprobe visibility should still cast shadows during baking. They should only not bounce indirect lighting. This is more visible now that shadow linking is supported. Fix #128812 --- source/blender/draw/engines/eevee_next/eevee_instance.cc | 5 ----- source/blender/draw/engines/eevee_next/eevee_material.cc | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.cc b/source/blender/draw/engines/eevee_next/eevee_instance.cc index 1999230b3a8..2159c6a371f 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.cc +++ b/source/blender/draw/engines/eevee_next/eevee_instance.cc @@ -311,11 +311,6 @@ void Instance::object_sync_render(void *instance_, { UNUSED_VARS(engine, depsgraph); Instance &inst = *reinterpret_cast(instance_); - - if (inst.is_baking() && ob->visibility_flag & OB_HIDE_PROBE_VOLUME) { - return; - } - inst.object_sync(ob); } diff --git a/source/blender/draw/engines/eevee_next/eevee_material.cc b/source/blender/draw/engines/eevee_next/eevee_material.cc index b2fd61767fb..9f037cef6c4 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.cc +++ b/source/blender/draw/engines/eevee_next/eevee_material.cc @@ -303,11 +303,16 @@ Material &MaterialModule::material_sync(Object *ob, Material &mat = material_map_.lookup_or_add_cb(material_key, [&]() { Material mat; if (inst_.is_baking()) { + if (ob->visibility_flag & OB_HIDE_PROBE_VOLUME) { + mat.capture = MaterialPass(); + } + else { + mat.capture = material_pass_get(ob, blender_mat, MAT_PIPE_CAPTURE, geometry_type); + } mat.prepass = MaterialPass(); /* TODO(fclem): Still need the shading pass for correct attribute extraction. Would be better * to avoid this shader compilation in another context. */ mat.shading = material_pass_get(ob, blender_mat, surface_pipe, geometry_type); - mat.capture = material_pass_get(ob, blender_mat, MAT_PIPE_CAPTURE, geometry_type); mat.overlap_masking = MaterialPass(); mat.lightprobe_sphere_prepass = MaterialPass(); mat.lightprobe_sphere_shading = MaterialPass();