Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TCastlePunctualLight.Mode2D (one use-case: Tiled maps and spotlights (Z axis problems)) #726

Copy link
Copy link

Description

@bbrtj
Issue body actions

As discussed on discord, tiled maps have huge Z-axis gaps between their layers, which render fine under orthographic projection, but can't properly receive light from spotlights, which operate in 3D space. Each layer gets illuminated differently because of the light cone hitting the layers differently as they get further from the light source.

I see two workarounds right now:

  • apply a tiny Z scaling to tiled maps, like 0.001, which puts them all in more or less the same Z position (tested and works, but Michalis says this can cause rendering problems)
  • use ridiculously large numbers in the spotlight's Radius and Z Translation, and a very small BeamWidth / CutoffAngle, so that the huge distances between the tiled layers no longer make any visible difference (untested)

Ideally, spotlights would "just work" same as camera in orthographic projection, which seems to ignore Z axis distances. This would also mean Attenuation should not make any difference (makes little sense in 2D games anyway).

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.