Page 1 of 1

Deferred Rendering?

Posted: Tue Nov 27, 2012 10:04 pm
by OmarShehata
I'm really stuck on this.

I have my lighting system, and in the normal, forward rendering way, if you have 100 lights, you're going to loop through every pixel of every object 100 times...which is A LOT, this is so that you can calculate the combined effects of lights.

Instead, I want to group those 100 lights into a canvas, multiplying their colors, effectively combining their effects, and taking this final canvas, and multiplying the colors of the pixels by the pixels of my object. So you can effectively have hundreds and hundreds of lights, but it will be treated almost as one light!

So what I'm stuck on is somehow grouping my lights into a canvas. Any ideas?

=====What I've tried=========
-Drawing the lights as circles on a canvas, but since I'm just drawing them, they get added onto each other, so their colors don't blend


...that's about it. Any help or ideas would be appreciated!

Re: Deferred Rendering?

Posted: Wed Nov 28, 2012 1:10 am
by Dola
Take a look at love.graphics.setBlendMode.

Re: Deferred Rendering?

Posted: Wed Nov 28, 2012 9:29 pm
by Inny
I put together a short demo of what the different transparency modes do. Maybe this can help you figure out what you want to do with your lighting engine.

up/down/left/right: change scaling, use this to overlap the color swatches
pageup/pagedown/home/end: shear the color swatches, I was testing something unrelated with this
A/Z: change the alpha channel for all colors
space/shift-space: cycle though the blending modes
w: change background color to white (for subtractive/multiplicative modes)

alpha may be enough, in the sense that you can just have white/yellow circles that are overlapped on the light sources.

Re: Deferred Rendering?

Posted: Thu Nov 29, 2012 2:36 pm
by OmarShehata
This is exactly what I need! Thanks!