Skip to content

Iso 2.0 [8/12]: Shadow + Rim Lighting (sun angle, path-based shadows, face tinting) #222

@putersdcat

Description

@putersdcat

Spec reference

IsoRenderingPlanV2.1.md §4 Advanced Rendering; §Addendum B §4 Lighting

Goal

Two lighting effects:

  1. Shadow: positive-Z nanos cast a small elliptical shadow on the ground plane
    offset by sun azimuth angle and altitude. drawNanoShadow(ctx, nano, sx, sy, sun).
  2. Rim lighting: sun-facing faces of extruded nanos are lightened; opposite faces
    are darkened. Applied via ctx.fillStyle rgba overlays on front/cap faces.

Technical requirements

  • SunState = { azimuth: number, altitude: number, shadowLength: number, shadowAlpha: number }
  • computeShadowOffset(sun, zOffset) → { dx, dy }
  • Shadow: small filled ellipse at (cx+dx, cy+dy), rgba(0,0,0,shadowAlpha×0.5)
  • Rim: front face gets rgba(255,255,255,0.1) overlay; cap face gets rgba(0,0,0,0.2)

Acceptance criteria (ALL required to close)

  • render_nano_tile stone-wall straight-h with sun from NE → shadow offset NW of tile, front face brighter, cap face darker.
  • render_nano_tile stone-wall straight-h with sun from NW → shadow offset NE.
  • Shadow changes direction between the two renders (delta dx visible).
  • PNGs committed: ProgressEvaluations/lighting-shadow-ne-sun.png, lighting-shadow-nw-sun.png.
  • No sun → no shadow (shadowAlpha=0 → no shadow drawn).

Metadata

Metadata

Assignees

No one assigned

    Labels

    iso-2.0-experimentIsometric Rendering 2.0 clean-sheet experimentrenderingRendering engine

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions