3D: дымка идёт за камерой (отдаление больше не «сереет»); «Улучшить» оживает, когда ресурсов стало хватать

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alexander
2026-11-05 17:12:10 +01:00
co-authored by Claude Opus 5.5
parent 5502489c07
commit 35319be8ca
3 changed files with 29 additions and 1 deletions
+9
View File
@@ -99,11 +99,20 @@ public class City3DCamera : MonoBehaviour
target.y = 0;
}
// Дымка начинается за городом, а не на фиксированном расстоянии от камеры: иначе при отдалении весь город
// уходил в серую дымку -- казалось, что камера не отдаляется, а сцена сереет (05.11)
public float fogStartBehind = 4f, fogEndBehind = 59f;
public void Apply()
{
Quaternion rot = Quaternion.Euler(pitch, yaw, 0);
transform.rotation = rot;
transform.position = target - rot * Vector3.forward * distance;
if (RenderSettings.fog && RenderSettings.fogMode == FogMode.Linear)
{
RenderSettings.fogStartDistance = distance + fogStartBehind;
RenderSettings.fogEndDistance = distance + fogEndBehind;
}
}
// Точка на плоскости земли (y = 0) под экранной точкой