Fix #125618: EEVEE: Cryptomatte Material Layer Incorrect

Missing oversight in previous fix where incorrect name size where
used to generate the cryptomatte hash.

Pull Request: https://projects.blender.org/blender/blender/pulls/126352
This commit is contained in:
Jeroen Bakker
2024-08-15 08:41:12 +02:00
parent 04c5a9f053
commit 925753c83b

View File

@@ -614,8 +614,8 @@ void GPUCodegen::generate_cryptomatte()
float material_hash = 0.0f;
Material *material = GPU_material_get_material(&mat);
if (material) {
blender::bke::cryptomatte::CryptomatteHash hash(material->id.name + 2,
BLI_strnlen(material->id.name, MAX_NAME - 2));
blender::bke::cryptomatte::CryptomatteHash hash(
material->id.name + 2, BLI_strnlen(material->id.name + 2, MAX_NAME - 2));
material_hash = hash.float_encoded();
}
cryptomatte_input_->vec[0] = material_hash;