Skip to content

Sprite3d / 2.5D: built-in blob shadow helper #1515

Description

@obiot

Context

melonJS has no 3D shadow system. For 2.5D scenes (Paper Mario-style), characters read much better with a simple blob shadow on the ground. Today that's hand-rolled (a flat dark quad / Sprite3d with billboard: false, or a tinted Mesh) — see the "Shadows" caveat in 2.5D Games.

Proposal

Provide a small, opt-in helper so this is one line instead of boilerplate. Options to explore:

  • A ShadowQuad / BlobShadow renderable (soft-edged radial dark texture laid on the ground plane), with size + opacity, that can track a target's XZ (or XY) position.
  • Or a Sprite3d convenience (e.g. castGroundShadow: true) that spawns/positions a paired shadow quad under the sprite.

Keep it a pure helper on top of existing primitives — no new render pass.

Acceptance

  • One-call setup that renders a soft blob under a character and follows it.
  • Works under Camera3d; respects depth so it sits on the floor, under the sprite.
  • Example/wiki snippet.

Scope note: this is a fake shadow helper, not real shadow mapping (out of scope).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions