Shade problem with meshes
Hiya!
I'm using the D3DXMesh class to load and render objects into my scene. This works fine but there's a little problem when setting the shader mode to D3DSHADE_FLAT, you'll notice the polygons are either 50% or 100% and that's definitely wrong. The meshes are 3ds exports and as you can see on the left side the normals were calculated correctly. I truly have no idea why flat shading won't work here...
It's only the meshes btw, the floor is rendered 'by hand' with my own normal calculations.
Re: Shade problem with meshes
Yes it is. It's a 3ds max default box, so all sides are flat.
(didn't see that post, gomen^^;)
Re: Shade problem with meshes
Do you use any kind of light or something? Spot lights or something. If so make sure it hits any of the vertices on the left side of the box on the top too. And not in between, that won't help.
ØØ
Re: Shade problem with meshes
Also don't use D3DSHADE_FLAT. The large quads in your terrain all get colored only one shade using D3DSHADE_FLAT. Try using D3DSHADE_GOURAUD or even better, D3DSHADE_PHONG.
And the reason why your polygons are either 50% or 100% in your box and barrel is because some of your polygons' vertices aren't in the consistent clockwise or counter clockwise order (which depends on if you are using the LH or RH system). And as a result, the normals that are getting calculated on some of the wrong order polygons will be reversed and shaded 100% black as a result!) So be sure that those vertices are in the correct order.