-
problem with multiple lights
Hello! I have implemented a lighting pass and a shadow pass(shadow maps)...and i can combine them fine (using DST_COLOR,ZERO) but ive been tinkering and I cant seem to get them to combine in a way that would allow multiple lights! Ive tried using a combination of the alpha buffer and stencil buffer but i cant get the settings right. Any suggestions?
(btw....the lighting pass has no room left in it, hence the multi pass method).
-
Advanced Member
Frequent Contributor
Re: problem with multiple lights
For each light source:
- Disable RGB writes; render shadowing to destination alpha without blending.
- Enable RGB writes; render lighting with (GL_DST_ALPHA, GL_ONE) blending.
Also, for everything except the very first pass (the shadow pass of the first light, or possibly an ambient pass), use a GL_EQUAL depthfunc.
-- Tom
-
Re: problem with multiple lights
dude, i love u!!
...hehe. I think I should sleep more, then I wont have to ask such stupid questions at this time of night...cheers!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules