Sign in to follow this  
PrincessDaisy

Replacing FVF calls with Vertex Declarations in DX9

Recommended Posts

Is it possible to use D3D's vertex declarations and D3DVERTEXELEMENT9 structures in-place of FVF declarations in the fixed function pipeline? My engine is currently 100% FF, and I am in the process of playing around with Cg, and I would like it to be possible for the end-user to use shaders when they want, and the FF pipeline anyother time. The SDK doc's are quite vague on the usage of D3DVERTEXELEMENT9 structures, and their relationship to custom FVF declarations. Ideally, I would like to use one or the other, rather than having to check if the user is declaring vertex shaders or not and using something else. Thanks Daisy

Share this post


Link to post
Share on other sites
Did you write these tutorials? If so, they are very nicely done :)

A couple of questions though. The tutorial you pointed to did indeed use the vertex declarations using D3DVERTEXELEMENT9, but used DrawPrimitiveUP. But in a later tutorial which specifically uses index and vertex buffers, FVF formats are used instead.

Is there a specific reason for this?

Also, I read somewhere that as it is for use with shaders, only shader compatable crads can actually use them. My laptop machine doesn't actually have any shader support, so can I still them?

Thanks for your quick reply
Daisy

Share this post


Link to post
Share on other sites
Quote:
Original post by PrincessDaisy
A couple of questions though. The tutorial you pointed to did indeed use the vertex declarations using D3DVERTEXELEMENT9, but used DrawPrimitiveUP. But in a later tutorial which specifically uses index and vertex buffers, FVF formats are used instead.

Is there a specific reason for this?

I didn't write the tutorials, so I can't say for sure, but using FVF codes is normally easier than declarations. If you don't need to do anything special, it's simply less work than using declarations.

Quote:
Original post by PrincessDaisy
Also, I read somewhere that as it is for use with shaders, only shader compatable crads can actually use them. My laptop machine doesn't actually have any shader support, so can I still them?

As of DX9, FVF and declarations are both valid as a part of the API. DX can translate between the two as needed for it's own internal considerations, but this is irrelevant. Both are supported on any card and driver, however, certain limitations do apply.

You can find more information about these limitations on this page (scroll about half way down).

Hope this helps :).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this