problem with textures + lighting

Started by
5 comments, last by hughiecoles 16 years, 3 months ago
i had a mini 3D world, 2 textured boxes, and a floor. but when i finished implementing the lighting and materials, i finally got the lights to work, but now the textures don't show. i'm wondering if it has anything to do with the order i set my FVF in , it goes XYZ|texture|normal and i'm wondering if the normal should go before the texture? if anyone has any idea if this is the problem, or on any other solutions, it'd help alot, thanks.
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
Advertisement
what r you using openGL or DX.

pls specify your code and describe the sequence of lighting setup.

"order i set my FVF in , it goes XYZ|texture|normal "

Have you set your vertx struct data in the same order as your FVF?
eg. for that FVF i think you would have something like:

struct Vertex
{
float x, y, z;//cooords
float u, v; // tex coords
float nx, ny, nz; //normals
}

PS: plz correct me if im wrong.
No. Bitwise OR is independant of order. A | B is exactly the same as B | A.

However, vertices declared with FVF's do have to be in a certain order. There's an image somewhere that showed the required order. It used to be in the DirectX SDK documentation, but I think they removed it for some reason.
NextWar: The Quest for Earth available now for Windows Phone 7.
it's directx, yes the vertex struct is in the right order, but i used a D3DVECTOR instead of 3 floats.
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
Using FVF, the normal should come before the texture. Using a vertex declaration you can use any order.
i reordered it, and it works fine now, thanks alot
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried

This topic is closed to new replies.

Advertisement