Jump to content
  • Advertisement
Sign in to follow this  
MarkS

I need some help with multiple lights and shadow mapping.

This topic is 2543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am really new to GLSL. I just implemented normal mapping and multiple light sources. I'm working in a Checkers game and I need four lights (one in each corner) to light the board properly. I have the look I want, but I want the pieces to cast shadows. I would be happy with hard shadows, although soft shadows would be nice. Regardless, I can find little online dealing with one light source shadow mapping, much less multiple lights and what I can find either doesn't incorporate texturing, or doesn't include the C++ source with the shaders (what the heck is with Ozone3D anyway!?).

What I need is a good tutorial that explains how to implement this, but I am not finding any. Even if I could sit down and write the shader code without assistance, I don't have the slightest clue how to integrate it into my program.

Share this post


Link to post
Share on other sites
Advertisement
Deferred shading is best for multiple lights
If you are sure that there will be always 4 lights than it is really easy to modify one light shader to multiple lights
There is only few things you should modify
- 4 depth textures
- 4 light matrices
- combine shadows: sum, distance based, light power...

Share this post


Link to post
Share on other sites
I decided to simplify. I was able to reduce the light count to one by setting some of the light variables that I had forgotten to set. This brightened up the board and gave me the look I want. I looked into deferred shading and discounted it. It would be the best method, but not a good method to teach myself GLSL. It is rather advanced, possibly too advanced for what should be a rather simple project.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!