D3D Lighting without Hundreds of Vertices
I was wondering, is there a way to get D3D to light a polygon without having to have a ton of vertices defining it? I would perfere it if I only had to define the edges of the polygon and it light the center without all the internal vertices. Unless I create hundreds of vertices the lighting affects look triangular, and this is not in flat shading mode. It would be alot simpler (although probably a cycle hog) if there was a way to do it this way. Anybody know if it is possible?
-Omalacon
First of all, do not use D3D Lighting. It only interpolates between triangle verticies. Something you have seen. Your only solution is to use light maps. When you specify your texture, specify a second texture that is your light map. More in-depth articles are at http://www.flipcode.com
Had a relavint question. Can you turn off all light just by useing SetRenderState? thanks

I think you can disable lighting with setrenderstate. In my engine, I disable it in hopes that my engine will run faster. See below
----------------------------------
''DX Lighting Sucks! Use light maps
frmDebug.PrintDebug "Disabling DirectX Default Lighting Engine...", False
.SetRenderState D3DRENDERSTATE_LIGHTING, False
.SetRenderState D3DRENDERSTATE_SPECULARENABLE, False
----------------------------------
----------------------------------
''DX Lighting Sucks! Use light maps
frmDebug.PrintDebug "Disabling DirectX Default Lighting Engine...", False
.SetRenderState D3DRENDERSTATE_LIGHTING, False
.SetRenderState D3DRENDERSTATE_SPECULARENABLE, False
----------------------------------
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement