feat: cel-shaded look — toon shader, ink outlines, stylized environment

- toon.gdshader: banded diffuse with cool-tinted shadows (3 tones), stepped
  specular, rim light, and an optional world-triplanar albedo path so level
  geometry keeps the 0.5 m grid with no UVs
- toon_outline.gdshader: inverted-hull ink outline, applied via
  material_overlay so it works on skinned (deforming) meshes
- LevelMaterials: tinted() now returns toon grid materials; toonify()/
  apply_toon_recursive() convert imported character/prop materials in place
- SkinnedPlayerModel: characters get toon shading + outline on load
- LevelEnvironment: shared stylized environment for all maps — saturated
  anime sky, linear tonemap (filmic/ACES crush cel bands), bloom for
  emissives, saturation+contrast grade, light depth haze; test level and
  dust2 now use it and the procedural arena (which had NO environment)
  gets it plus runtime toonification of its baked geometry

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Nicholas Butzke
2026-07-17 13:37:27 -04:00
co-authored by Claude Fable 5
parent 2c7b5a1aca
commit 37c15bed1a
11 changed files with 274 additions and 60 deletions
+6 -41
View File
@@ -96,29 +96,9 @@ func _ramp_static(pos: Vector3, size: Vector3, rot_deg: Vector3, color: Color, n
# ── Environment ───────────────────────────────────────────────────────────────
func _build_environment() -> void:
var env := WorldEnvironment.new()
env.name = "WorldEnvironment"
var environment := Environment.new()
environment.background_mode = Environment.BG_SKY
var sky := Sky.new()
var sky_mat := ProceduralSkyMaterial.new()
sky_mat.sky_top_color = Color(0.15, 0.2, 0.35)
sky_mat.sky_horizon_color = Color(0.45, 0.5, 0.65)
sky_mat.ground_bottom_color = Color(0.1, 0.08, 0.06)
sky_mat.ground_horizon_color = Color(0.35, 0.3, 0.25)
sky.sky_material = sky_mat
environment.sky = sky
environment.ambient_light_source = Environment.AMBIENT_SOURCE_SKY
environment.ambient_light_energy = 0.4
environment.tonemap_mode = Environment.TONE_MAPPER_FILMIC
environment.glow_enabled = true
environment.glow_intensity = 0.3
environment.glow_bloom = 0.1
environment.fog_enabled = true
environment.fog_light_color = Color(0.5, 0.55, 0.65)
environment.fog_density = 0.002
env.environment = environment
add_child(env)
# Shared stylized environment (anime sky, bloom, cel color grade).
# Also creates the Sun/FillLight pair since none exists yet.
LevelEnvironment.add_to(self)
# ── Floor ─────────────────────────────────────────────────────────────────────
@@ -261,24 +241,9 @@ func _build_target_dummy() -> void:
# ── Lighting ──────────────────────────────────────────────────────────────────
func _build_lighting() -> void:
var sun := DirectionalLight3D.new()
sun.name = "Sun"
sun.rotation_degrees = Vector3(-50, 30, 0)
sun.light_color = Color(1.0, 0.95, 0.85)
sun.light_energy = 1.2
sun.shadow_enabled = true
sun.directional_shadow_mode = DirectionalLight3D.SHADOW_PARALLEL_4_SPLITS
sun.directional_shadow_max_distance = 100.0
add_child(sun)
# Fill light (opposite side)
var fill := DirectionalLight3D.new()
fill.name = "FillLight"
fill.rotation_degrees = Vector3(-30, -150, 0)
fill.light_color = Color(0.6, 0.7, 0.9)
fill.light_energy = 0.3
fill.shadow_enabled = false
add_child(fill)
# Sun and fill are created by LevelEnvironment.add_to in _build_environment;
# kept as a hook for subclasses that re-style them (see dust2).
pass
# ── Player ────────────────────────────────────────────────────────────────────