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

CG Shadowing: using multiple lights

Started by Subotron Jan 30, 2007 at 5:58 PM 1 replies 1.5k views
Original Post
Subotron
Subotron
I am trying to implement CG shadowing to give my models a nice shadow. However, I currently have a design issue. The shader uses light info to generate the shadows. This means I pass a few parameters to the shader, like the position of the light. However, I was uncertain how to adjust the shader to work with multiple lights. Think about walking past street lights, where you have more than one shadow when you walk in between lights, or just cancellation of a shadow because of another light. I was wondering if it is possible to adjust my shader to allow more lights, and what would be the best way to pass the light info to the shader (I do not like the idea of passing 16 parameters or so just for light info). Any pointers would be great. Thanks in advance!
zedzeek
zedzeek
u havent said what method u use for shadowing
eg shadowmaps, stencil shadows etc
if its SMs then u will need to access a different SM for each light
Subotron
Subotron
I use stencil shadows (my algorithm is based on the Z-fail algorithm)

Topic Locked

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

Sign in to reply to this topic.