Skip to main content
GameDev.net gamedev.net
🔒 Locked

Per pixel multiple lights

Started by b3rs3rk Jul 10, 2004 at 5:53 PM 2 replies 1k views
Original Post
b3rs3rk
b3rs3rk
i know i have to render the scene for each light. ok, that's what i do.. but on the screen i have only one light, only the last i render :/ (i mean, if i have 2 lights,named A and B, if i render the map in this order Draw(light[A]); Draw(light); on the screen i've only the B light) there should be something i dunno... probably with texture combiners :/
Corrail
Corrail
You could use Blending functions for this:

Draw(light[A]);
glBlendFunc(GL_ONE, GL_ONE);
Draw(light);
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
vincoof
vincoof
Technically, there are only two ways of achieving multiple lights contributions :
1- add all light contributions in the pixel shader, granted that you don't exceed the pixel shader instruction limit,
2- render the object in multipass, granted that you can setup blending stages accordingly (eg there is a lot of problem in multipassing translucent objects).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.