I'm developing a Direct3D graphics rendering engine which is being based around DX7 generation features, that is, fixed-function hardware T&L, cube mapping and dual texturing. The very cornerstone feature of the engine is arbitrary multitexturing, which naturally means heavy use of multipass techniques. Here are a couple of screenshots, using "programmer's art", if anyone's interested:
http://jt7-315a.tky.hut.fi/a2.jpg
http://jt7-315a.tky.hut.fi/a2.jpg
Besides the performance issues, the multipass rendering has a downside that it completely screws up the hardware fog blending stage. For any materials using other than basic alpha blendng, fog has to be done in a separate pass. I've spent countless hours on hitting my head on the wall on how to do this. Following works, but only produces black fog:
1) Set material color to white and no texture
2) Enable fog with desired range, and set color to black
3) Enable blending, and render objects the following way:
- Zero as source blending factor.
- Source color as destination blending factor. Thus vertexes up close end up the original color (DESTINATION * WHITE) and the far off vertexes end up black (DESTINATION * BLACK)
The vertex-based range fog is lightning fast on any GF-class hardware, and looks fantastic. Is there any way to render it in a separate blended pass on DX7 class hardware? I'd really hate to resort to pixel or vertex shaders, because the performance in software emulation mode would be horrid, since the game using the engine will have moderately high polycounts.
http://jt7-315a.tky.hut.fi/a2.jpg
http://jt7-315a.tky.hut.fi/a2.jpg
Besides the performance issues, the multipass rendering has a downside that it completely screws up the hardware fog blending stage. For any materials using other than basic alpha blendng, fog has to be done in a separate pass. I've spent countless hours on hitting my head on the wall on how to do this. Following works, but only produces black fog:
1) Set material color to white and no texture
2) Enable fog with desired range, and set color to black
3) Enable blending, and render objects the following way:
- Zero as source blending factor.
- Source color as destination blending factor. Thus vertexes up close end up the original color (DESTINATION * WHITE) and the far off vertexes end up black (DESTINATION * BLACK)
The vertex-based range fog is lightning fast on any GF-class hardware, and looks fantastic. Is there any way to render it in a separate blended pass on DX7 class hardware? I'd really hate to resort to pixel or vertex shaders, because the performance in software emulation mode would be horrid, since the game using the engine will have moderately high polycounts.