Multiple Dynamic Lights

posted in I am a duck
Published February 14, 2011
Advertisement
I put the finishing touches on my basic lighting model this weekend. Nothing too special but I can now have an arbitrary number of lights passed into the fragment shader to use for lighting. The lights are just basic directional lights but they get the job done for now and more importantly no longer contain any hard coded values.

Now that I have a basic level of rendering together I'm going to move onto the input system. It's nice having some pretty pictures being drawn but right now I don't have any way to interact with any objects in the scene to really see how the lighting holds up to real time movement.

I present another duck shot with one green light and one red light coming in from different sides of the duck model.

gallery_79488_71_17030.png
0 likes 2 comments

Comments

Jason Z
Hey - your specular reflections are all white, even if your lights are different colors!!!
February 14, 2011 09:25 PM
Mike Bossy
Yeah, that's a feature not a bug! The shader code I'm using lets you define a specular colour in addition to the diffuse colour. I'm not sure in which context you'd want that but the important thing for now is that it works :)
February 14, 2011 10:19 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement