Archived

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

Pactuul

D3DX Lighting

Recommended Posts

Pactuul    122
Well, i''m not sure if i understand how the lighting works... I''ve got the lighting to work correctly. Except that lights will go through my meshes. Does directx lights always do this? and if so, is there a way to get it to stop "projecting light" once it''s hit a polygon? -pac

Share this post


Link to post
Share on other sites
Freeman_CIT    122
I am not sure what you mean, but if you mean "there are no shadows in my scene", it''s normal. Shadow casting need a complete implementation (see DX8 tutorial). DX8 lights will light up your meshes but won''t cast shadow. you need to code some kind of shadow casting method (ligthmap, calculated projections of an object, stencil buffers, etc...)

(I am not completely sure DX8 dosen''t compute shadow at all, but that''s what I have seen so far)

Freeman

Share this post


Link to post
Share on other sites
Muhammad Haggag    1358
DirectX Graphics lighting is straight-forward vertex lighting.
Vertex lighting is a type of lighting where the lighting parameters are : The vertex ( pos, normal, ...etc ) & the light source ( pos, color, intensity ).

This , as you can see, doesn''t take into consideration the obstacles encountered when the light ray traversed from the light source to the lit vertex. To do this, you''d have to implement a completely different lighting subsystem ( And I''ve never seen it done before, not even in QuakeIII Arena. In Q3A, many times you''d see the light wave produced by a rocket explosion on the OTHER side of the wall, due to the reasons stated above )

Share this post


Link to post
Share on other sites
S1CA    1418
If you were doing projected shadow mapping, what you could do is use the projected map to modulate the vertex colour of the shadowed object.

However this doesn''t take effects of global illumination/secondary lighting into account - for that you have to start looking at other ideas.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Pactuul    122
well, i''m not interested in the shadows (not yet at least) I would like to implement a nice lighting techinque in my scene.

I''ve coded a quite nice scene graph hierarchy that works. Now i''m trying to figure out ways to correctly light my scene. I''m not completely concerned for speed (unless it''s a fps crippling).
I''ve heard about lightmaps, projected textures, and ray casting.

I''m just not sure which works best for my current setup. any ideas?

Share this post


Link to post
Share on other sites