I'm currently working on a project using C++ and DirectX 9 where I have to render a world made up of small building blocks, more specifically lego bricks. As there are thousands of these bricks and I quickly ran into performance issues, I applied instancing to render all small objects with the same mesh in one draw call using a programmed HLSL shader. Previously, as another means to improve performance, I had set up D3D enabling D3DCREATE_HARDWARE_VERTEXPROCESSING and D3DCREATE_PUREDEVICE for vertex processing, what almost doubled the frame rate back then. However, as it turns out, if I keep these settings when using instancing, the whole scene is rendered black. If I switch back to D3DCREATE_SOFTWARE_VERTEXPROCESSING everything is rendered fine, again.
Are usage of D3DCREATE_HARDWARE_VERTEXPROCESSING and instancing in DirectX 9 mutually exclusive or is there some additional flag or parameter that I have to set to alllow both optimizations at once? If you know any other way of optimizing for rendering multiple instances of the same mesh (with chaning position, rotation and colour), feel free to share your thoughts on those, as well.
You don't find alot of ressources on instancing with DirectX 9 on the internet, so I hope you guys can help me. Any advice is appreciated.
This is my first post here and I'm not a native English speaker, so have some mercy