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

using multiple light layers #52

Open
alwex opened this issue Apr 16, 2015 · 2 comments
Open

using multiple light layers #52

alwex opened this issue Apr 16, 2015 · 2 comments

Comments

@alwex
Copy link

alwex commented Apr 16, 2015

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

@lampione
Copy link

This would be awesome, there are some major issues handling lights plus viewports. My game has multiple viewports and I can't sort this out.

@rinold
Copy link
Contributor

rinold commented Aug 31, 2016

Currently this might be achieved using rendering to FBO, which should work fine. Custom viewports are also supported (in wiki there is some info about viewports).

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

3 participants