I'm new to DirectX and having trouble getting colors & lighting to work.
I want to be able to load various colored vertices into a single vertex buffer and enable with directional lighting, however every method I try has problems. Imagine I want to render 3 cubes, red green & blue respectively, with white directional lighting from the back.
1) I don't want to set the color via device.Material because then I'd have to make a separate call to DrawPrimitives() for each cube.
2) Working from samples, I seem to be able to get something working by using CustomVertex.PositionNormalColored - problem is I'm not really clever enough to set the Normal vertex programmatically. (Any tips? I don't want anything fancy, just for the lighting to work.)
3) CustomVertex.PositionColored seems ideal but doesn't seem to work with I turn on lighting and add a direction light, it seems to want the Normal vector.
I don't really have a stable code sample to provide but would appreciate any general advice on how to implement this - what CustomVertex to use, what's necessary for directional lighting to work, etc.
-Brendan