XNA Game Development Forums
2012/05/18 06:57:54 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Multiple Lights  (Read 2153 times)
Zwigby
Newbie
*
Offline Offline

Posts: 3


View Profile
« on: 2007/03/22 14:59:13 »

Hi all, it's my first post.

I was wondering what is the best way to approach multiple light sources?

How do the pros do it? Is it with shader and passing in a bunch of variable telling how many lights of what kind then going from there?

Thanks in advance.

Charlie
Logged
EclipsE
Full Member
***
Offline Offline

Posts: 111


View Profile
« Reply #1 on: 2007/03/22 15:44:59 »

I've done it using arrays in shaders and making a light manager, which will contain all the lights, their directions etc...
Logged
listentorick
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #2 on: 2007/06/03 15:10:52 »

Any chance we could look at the source code for this?
Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #3 on: 2007/06/03 22:05:50 »

Whats your performance on this? Generally one of the best ways to do accurate and quick multiple light sources is through deferred shading, there was a sample on www.ziggyware.com about it. Although it has it's drawbacks, it allows you to do the shadowing as well with the multiple lights since that can take a while being done normally.
Logged

Arkcann
Newbie
*
Offline Offline

Posts: 23


View Profile
« Reply #4 on: 2007/06/04 05:11:52 »

I've been working on multiple light sources and have managed to have multiple point lights using a system that is quite intuitive and easy to change. However, I've only managed to get 4 lights working per vertex (while also doing ambient, diffuse and specular lighting) or 2 lights working per pixel (same thing, ambient, diffuse, and specular enabled) while using ps2_0 and vs2_0. Anything more uses to many math operations. Thanks for mentioning deferred shading, I've seen it on RenderMonkey but didn't realize how benificial it might be.
Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #5 on: 2007/06/06 00:22:47 »

Problem is it seems to stop you from doing things like AA with HDR, I forget those details, but that doesnt make too much of a difference, all depends on how you implement it I guess.
Logged

Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Multiple postscreen shaders Hazy Mind XNA Engine EclipsE 2 1670 Last post 2007/04/29 21:50:58
by Chr0n1x
Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.176 seconds with 19 queries.