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!
Deferred Rendering?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- OmarShehata
- Party member
- Posts: 259
- Joined: Tue May 29, 2012 6:46 pm
- Location: Egypt
- Contact:
Re: Deferred Rendering?
Take a look at love.graphics.setBlendMode.
Re: Deferred Rendering?
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.
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.
- Attachments
-
- alphatest.love
- (1.08 KiB) Downloaded 173 times
- OmarShehata
- Party member
- Posts: 259
- Joined: Tue May 29, 2012 6:46 pm
- Location: Egypt
- Contact:
Re: Deferred Rendering?
This is exactly what I need! Thanks!
Who is online
Users browsing this forum: No registered users and 3 guests