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

Multi-pass lighting: More than 8 lights #5

Open
mcmonkey4eva opened this issue Nov 20, 2014 · 1 comment
Open

Multi-pass lighting: More than 8 lights #5

mcmonkey4eva opened this issue Nov 20, 2014 · 1 comment

Comments

@mcmonkey4eva
Copy link

It would be amazing if you used multi-pass lighting and etc. techniques I know very little about to allow more than 8 lights at one time.
The rough idea, as I've read it, is that you render the scene with the first 8 GL lights, then with the next set, then the next, and keep going until all lights are rendered.
... There's probably a better way to render large numbers of lights. Thus why I'm asking you, the much more skilled-with-OpenGL developer, to look into the possibilities.

@jeske
Copy link
Owner

jeske commented Nov 20, 2014

No, you don't render the scene with the 8 GL lights over and over. That doesn't really work.

Right now the most popular forms of multi-pass lighting are deferred shading and deferred lighting, and I plan to include one of them at some point. The scene is rendered once into a non-lit framebuffer format called a g-buffer (z, diffuse, and surface-normal for each screen-space pixel). Then each light is "rendered" as a polygonal shape, using the g-buffer data to compute it's contribution to the final scene. This allows efficient creation of hundreds of lights for the fixed-cost of one (or two) extra rendering passes.

https://en.wikipedia.org/wiki/Deferred_shading

If you want to be really blown away, you can look at this bleeding edge research on how to use the latest hardware features (virtual textures) to also support tens or hundreds of unique shadow maps, at least for point lights.

http://www.cse.chalmers.se/~olaolss/main_frame.php?contents=publication&id=clustered_with_shadows

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

2 participants