So far I've found out that you need to create a ID3D10BlendState object, call CreateBlendState() with a D3D10_BLEND_DESC struct, and call OMSetBlendState(). But I don't know how to call the Draw() functions and how to Apply() the textures. I have lightmap textures that I need to be blended with normal textures. Do I need multiple texture coordinates for the vertices? Do I need to draw each poly twice, once for the texture and once for the lightmap? I also don't really want to use texture arrays.
Thanks in advance.
There's no reason to use DirectX 10. DirectX 11 fully supplants it on all the same platforms (Windows Vista SP2 or later all support DirectX 11), and supports a wider range of video hardware. In addition, the only place to find DirectX 10 samples and utility code is in the legacy DirectX SDK. For DirectX 11, there are numerous open-source replacements for the old deprecated
D3DX
library, as well as samples.Direct3D 10 and later all use programmable shaders rather than the legacy 'fixed function' pipeline. Therefore, the way you'd implement light mapping is in a pixel shader written in HLSL:
You'd build this offline with
FXC
and then bind it at run-time along with a vertex shader. Typically for light-maps you'd use two texture coordinate sets in the input layout: