Merge pull request #89281 from permelin/fix-lm-capture-octant

Fix lightmap captures not applied in one octant
This commit is contained in:
Rémi Verschelde 2024-03-09 00:52:19 +01:00
commit 5c6614fd52
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -2053,7 +2053,7 @@ void RendererSceneCull::_update_instance_lightmap_captures(Instance *p_instance)
Vector3 inner_pos = ((lm_pos - bounds.position) / bounds.size) * 2.0 - Vector3(1.0, 1.0, 1.0);
real_t blend = MAX(inner_pos.x, MAX(inner_pos.y, inner_pos.z));
real_t blend = MAX(ABS(inner_pos.x), MAX(ABS(inner_pos.y), ABS(inner_pos.z)));
//make blend more rounded
blend = Math::lerp(inner_pos.length(), blend, blend);
blend *= blend;