Fix: EEVEE: Lightprobe Volume backfacing toggle is inverted

The UI property was changed 7b97bc48d8
to a negative boolean but the boolean conversion inside EEVEE was
not inverted.

This mean that since 4.2, the default behavior for Lightprobe
volume has been broken / inverted.

To make an existing scene bake the same as before, all material
needs to have their `BackFace Culling > Light Probe Volume` options
inverted. This is done automatically through the versioning code.

The only test cases broken are the ones using default materials which
do not have their property turned off.

Release Notes should contains the compatibility breakage.

Pull Request: https://projects.blender.org/blender/blender/pulls/147218
This commit is contained in:
Clément Foucault
2025-10-08 14:55:14 +02:00
committed by Clément Foucault
parent 9a8fb5fe98
commit ab4c245a7e
5 changed files with 13 additions and 6 deletions

View File

@@ -27,7 +27,7 @@
/* Blender file format version. */ /* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION #define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 106 #define BLENDER_FILE_SUBVERSION 107
/* Minimum Blender version that supports reading file written with the current /* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and cancel loading the file, showing a warning to * version. Older Blender versions will test this and cancel loading the file, showing a warning to

View File

@@ -3958,6 +3958,13 @@ void blo_do_versions_500(FileData *fd, Library * /*lib*/, Main *bmain)
FOREACH_NODETREE_END; FOREACH_NODETREE_END;
} }
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 107)) {
LISTBASE_FOREACH (Material *, material, &bmain->materials) {
/* The flag was actually interpreted as reversed. */
material->blend_flag ^= MA_BL_LIGHTPROBE_VOLUME_DOUBLE_SIDED;
}
}
/** /**
* Always bump subversion in BKE_blender_version.h when adding versioning * Always bump subversion in BKE_blender_version.h when adding versioning
* code here, and wrap it inside a MAIN_VERSION_FILE_ATLEAST check. * code here, and wrap it inside a MAIN_VERSION_FILE_ATLEAST check.

View File

@@ -1540,7 +1540,7 @@ PassMain::Sub *CapturePipeline::surface_material_add(::Material *blender_mat, GP
GPUPass *gpupass = GPU_material_get_pass(gpumat); GPUPass *gpupass = GPU_material_get_pass(gpumat);
sub_pass.shader_set(GPU_pass_shader_get(gpupass)); sub_pass.shader_set(GPU_pass_shader_get(gpupass));
sub_pass.push_constant("is_double_sided", sub_pass.push_constant("is_double_sided",
!(blender_mat->blend_flag & MA_BL_LIGHTPROBE_VOLUME_DOUBLE_SIDED)); bool(blender_mat->blend_flag & MA_BL_LIGHTPROBE_VOLUME_DOUBLE_SIDED));
return &sub_pass; return &sub_pass;
} }

Binary file not shown.

Binary file not shown.