Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borked Lighting System on Rougelike Map #38

Open
mikewesthad opened this issue Jan 16, 2017 · 2 comments
Open

Borked Lighting System on Rougelike Map #38

mikewesthad opened this issue Jan 16, 2017 · 2 comments

Comments

@mikewesthad
Copy link
Member

There's something wrong about how we are approaching lighting. I don't know if this is an issue we have always had or something new introduced by some of the more recent lighting system updates (or, more likely, a combination of the two).

Current algorithm:

  • Light rays are only being cast at walls that face away from the light ("back walls")
  • The cast light rays are then used to mask a shadow layer - only leaving shadow where there is no light

Problems:

  • Light rays are not hitting walls that face towards the light ("front walls"). The _getWallIntersection function is being run only using back walls, so essentially the front walls are completely ignored in lighting.
  • If we use the front walls in the lighting calculation, then the wall tiles themselves will appear in shadow. To fix that, we'd need to draw the lighting in a layered way. E.g. draw tilemap background layer, draw masked shadows, draw tilemap walls layer, draw lighting?

image

@mikewesthad
Copy link
Member Author

mikewesthad commented Jul 1, 2017

@mikewesthad
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant