Sign in to follow this  
meisawesome

help with vertex format lighting error

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this