Archived

This topic is now archived and is closed to further replies.

nes8bit

Lights

Recommended Posts

Ok, I''ve asked this one before, but how would I calculate the color of any point in space when I define a light source? Somethings I wonder about is: 1. What datatype should I use? Would D3DLIGHT do it? 2. What is the best equation for calculating the color given that there are no light collisions in the world. I''ve looked everywhere and when I find pseudo code, I get a bunch of math equations. I just say ewww and click on the {x}. Please, explain this to me as if I were a newbie. (that does dx) ------------------------ Captured Reality.

Share this post


Link to post
Share on other sites
Why not using the DX7 / OGL lighting engine? it has the ability to handle coloured lights (at least DX7 does). In the DX7Help document all the equations and formulae are given, so that''s a good reference if you want to code your own.



Share this post


Link to post
Share on other sites
No no, not vertex lighting. Vertex lighting looks like crap for most engines. Also, those equations are a little complex. I just need something simple.

------------------------
Captured Reality.

Share this post


Link to post
Share on other sites
Witchlord, do YOU have any good pages with pseudo lighting samples?


So far I''ve been applying light with just the distance formula and it doesn''t work too good.

------------------------
Captured Reality.

Share this post


Link to post
Share on other sites
quote: ''Vertex lighting looks like crap for most engines. ''
I know... Perhaps you can find some ideas in all the lightmap-tutorials, they often describe how to calculate the lightmaps, and normally they are pre-calculated and with per-pixel accuracy.

Share this post


Link to post
Share on other sites