libgdx / libgdx/box2dlights

using multiple light layers

Open
#52 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
265
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Hi, I think it could be a greate thing to be able to use multiple rayHandler (one per layer).
The main loop could be like this:

// render layer 0 (background)
map.render(0);
rayHandler1.updateAndRender();
// render layer 1 (front)
map.render(1);
rayHandler2.updateAndRender();

To achieve this, I think that the light/shadow shader may be disabled when the alpha chanel of a pixel is equal to 0, this way, the shadow of the front layer wont be casted to the back layer anymore.

for an example, see towerfall ascension game, they make use of 2 light layers (the background is not affected by the light on the foreground).

http://www.gamesaktuell.de/screenshots/original/2013/11/towerfall_ascension_2-pc-games.JPG

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the issue's proposed render sequence: map.render(0), rayHandler1.updateAndRender(), map.render(1), and rayHandler2.updateAndRender(). Examine how the light/shadow shader handles pixels with zero alpha. Done means multiple light layers can render independently so foreground lighting does not cast shadows onto the background.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.