HLSL and Vertex Buffers

Started by
5 comments, last by Endemoniada 16 years, 1 month ago
Hi guys, Do I still use the FFP vertex buffers with the FVF when I'm using HLSL or do I transition to something else ? Everything works fine now but I read in a few posts here that the FFP is becoming 'redundant', does that include the FVF vertex buffers ? Thanks.
Advertisement
Yeah, FVF is actually gone in Direct3D 10. You can certainly still use them with shaders in Direct3D9, however you won't be able to do all of the things you can do with vertex declarations.
You still have to use and set a vertex declaration, the vertex shader needs a valid one as input structure.
I'm using a vertex declaration now for my shaders, I make sure it matches the FVF.

How do I create my vertex buffer using the declaration and not the FVF ? Is D3D10 required for that ?

My video card doesn't support D3D10 (it's a 7600GT) so I have to stick with D3D9 for now.

Thanks.

PS - I'm using the March 2008 SDK
Supply 0 (zero) for the FVF parameter of CreateVertexBuffer. That'd tell Direct3D that you're using the buffer with a vertex declaration.
Even if you use a FVF in the Device, D3D9 takes it in consideration only if Vertex Declaration is null.
Ahh, nice and easy; I thought it would be complicated. I eliminated the FVF and it's working perfectly.

Thanks guys.

This topic is closed to new replies.

Advertisement