Files
Project-M/Assets/_Project/Scripts/Client/Presentation/DynamicLightConfig.cs
T
kronic 414f9ff62a Feel: Phase 1.5 lighting/atmosphere pass — dark ambient + dynamic lights
Dark-ambient, dynamic-light-first look (RoR2/Death Scourges reference),
built filter-agnostic so the pixel style composes on top:

- New DynamicLightSystem (client-only, PresentationSystemGroup): pooled
  point lights follow projectile ghosts; pulsing portal light during
  RoomExplore (same ExpeditionPortalPos authority as the beacon); soft
  resource-node glow that fades with harvest-shrink; short impact
  FLASHES fed by CombatFeedbackSystem's burst funnel (EmitColored +
  SpawnVfx -> RequestFlash). Knobs in DynamicLightConfig (scene object,
  code defaults when absent).
- Atmosphere darkened: WorldAtmosphereConfig/System palettes moved to
  the dark set (base cool dusk, arid burnt dusk, per-room biome consts
  darkened); scene fog switched Linear -> ExponentialSquared (the
  system's per-region DENSITY writes were dead in Linear mode);
  trilight ambient lowered; directional 1.9 -> 1.05 slightly warm.
- 6 landmark mood lights (warpgate cyan, artefact violet x2, survey
  camp warm x2, cabin warm); URP additional-lights-per-object 4 -> 8
  (was starving the existing Aether lights).
- Art-look gate material: Assets/Screenshots/artlook_{base,room}_
  pixel{ON,OFF}.png over the lit scene.

Verified: lights live in Play (20 static at base incl. new landmarks;
pooled dynamics active in-room: node glows + impact flashes), fog/
ambient values confirmed live, 466/466 EditMode, console clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 20:37:50 -07:00

52 lines
2.3 KiB
C#

using UnityEngine;
namespace ProjectM.Client
{
/// <summary>
/// Live-tunable knobs for <see cref="DynamicLightSystem"/> — the Phase 1.5 "dynamic-light-first" layer
/// (RoR2 trick: dark ambient + moving point lights carry the readability). Mirrors the
/// <see cref="WorldAtmosphereConfig"/> bridge idiom: a MonoBehaviour placed in the gameplay scene with a
/// static <see cref="Instance"/> the client presentation system reads (falling back to these same
/// defaults when absent). Pure presentation — never touches the simulation. Colours are sRGB.
/// </summary>
public sealed class DynamicLightConfig : MonoBehaviour
{
public static DynamicLightConfig Instance;
[Header("Master")]
public bool Enabled = true;
[Header("Projectile lights (pooled, follow every live projectile ghost)")]
[Min(0)] public int MaxProjectileLights = 24;
public Color ProjectileColor = new Color(0.45f, 0.85f, 1f, 1f);
[Min(0f)] public float ProjectileIntensity = 2.6f;
[Min(0.5f)] public float ProjectileRange = 7f;
[Header("Portal light (RoomExplore loot window — same position authority as the beacon)")]
public Color PortalColor = new Color(0.55f, 0.95f, 1f, 1f);
[Min(0f)] public float PortalIntensity = 3.5f;
[Min(0f)] public float PortalPulseAmp = 1.2f;
[Min(0.5f)] public float PortalRange = 13f;
[Header("Resource-node glow (soft pickup readability)")]
public bool NodeGlow = true;
[Min(0)] public int MaxNodeLights = 12;
public Color NodeColor = new Color(0.40f, 1f, 0.75f, 1f);
[Min(0f)] public float NodeIntensity = 1.3f;
[Min(0.5f)] public float NodeRange = 4.5f;
[Header("Impact flashes (fed by CombatFeedbackSystem's burst funnel)")]
[Min(0)] public int MaxFlashLights = 8;
public Color FlashDefaultColor = new Color(1f, 0.85f, 0.55f, 1f);
[Min(0f)] public float FlashIntensity = 3.2f;
[Min(0.5f)] public float FlashRange = 6.5f;
[Min(0.02f)] public float FlashDuration = 0.18f;
void OnEnable() { Instance = this; }
void OnDisable() { if (Instance == this) Instance = null; }
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
static void ResetStatics() { Instance = null; }
}
}