PDA

View Full Version : Dynamic lighting in forward rendering



somboon
06-29-2010, 05:31 PM
What should I do to add dynamic lighting support to my forward rendering part ?

I already use deferred shader for background geometry and it can support dynamic lighting
with ease.

But I decided to use forward rendering with difference technique on skinned character (cellshade with it's own self-shadowing shadowmap) but come in to the problem about dynamic lighting.

I've never tried to add dynamaic light to forward rendering part before , Is something like this plausible ?

1.has a set of the same shader with different effective light (like 1 light , 2 light , 20 light)

2.do some sphere intersection test of light against the character to determined if the light touch the character.

3.select the shader from 1 based on the number of light that touch the character.

If the above method are not plausible , please suggest me anything that I can look into.
(I use OpenGL 3.2 core profile).