Jump to content
  • Advertisement
Sign in to follow this  
meisawesome

help with vertex format lighting error

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

Hello im designing a landscape engine, i have a lightsouce located at the players location. for some reason the lightsource doesnt work on the vertices when i have diffuse. as soon as i take diffuse off the lightsource starts working again. What is wrong with the vertex format:
struct LANDSCAPE_VERTEX{
public:
	D3DXVECTOR3 pos;
	D3DXVECTOR3 normal;
    COLORREF color;
	D3DXVECTOR2 src;

	D3DXINLINE LANDSCAPE_VERTEX(D3DXVECTOR3& thepos, D3DXVECTOR3& thenormal, COLORREF thecolor, D3DXVECTOR2& thesrc){
		pos = thepos;
		color = thecolor;
		normal = thenormal;
		src = thesrc;
	}

	D3DXINLINE LANDSCAPE_VERTEX(){
		pos.x = pos.y = pos.z = src.x = src.y = 0.0f;
		color = 0xffffffff;
	}

	enum FVFFlags{
		flags = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1
	};
};

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!