Jump to content
  • Advertisement

Archived

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

johnnyBravo

Tutorial on light maps? dx8 or 9

This topic is 5476 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

Hey I''m trying to learn how to use light maps, but I can''t find any tutorials on how to do it? Or if someone could explain on what to do, eg whats in the structure CUSTOMVERTEX, or whats in the FVF etc, and how to use it.

Share this post


Link to post
Share on other sites
Advertisement
You basically add another texture to a polygon.
So the vertex structure, would need another set of UV, and the FVF should change from TEX1 to TEX2 showing were using 2 textures.
Then you set the proper TextureStageStates and render.

.lick

Share this post


Link to post
Share on other sites
ive tried that but for some reason it won''t work.

What I''ve decided on to use is a Colour Light Map.

i used this code slightly modified names from the sdk on colour light maps.


myDevice->SetTexture(0, myTexture[3]);

myDevice->SetTextureStageState( 0,D3DTSS_COLOROP, D3DTOP_MODULATE );
myDevice->SetTextureStageState( 0,D3DTSS_COLORARG1, D3DTA_TEXTURE );
myDevice->SetTextureStageState( 0,D3DTSS_COLORARG2, D3DTA_DIFFUSE );


do i still have to set the fvf tex to 2?

also with adding a second set of uv etc is this how i do it:

struct CUSTOMVERTEX3D
{
D3DXVECTOR3 position;
D3DXVECTOR3 normal;
D3DXVECTOR2 ctexture;
D3DXVECTOR2 mtexture;
};
#define D3DFVF_CUSTOMVERTEX3D (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX2)


thanx

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!