Sign in to follow this  

FVF and Vertex Declerations playing nice together.

Recommended Posts

Is it safe to use FVFs and Vertex Declerations in the same render setup? Say I render 3 meshes using FVFs and then i render a full screen quad using a vertex decleration. Is it ok to mix these or do you go one way or the other? If you can mix them what is the proper way to set and unset the Decl and FVF? Do you have to NULL the Decl out before you use another FVF and vice-versa?

Share this post

Link to post
Share on other sites
It is perfectly safe to mix FVFs and Vertex Declarations. In any case, the last call, either SetFVF or SetDeclaration, overrides all previous calls of any type.

Just FYI, SetFVF effectively calls SetDeclaration internally, and is really just a layer that was kept for backward compatibility.

Hope this helps.

Share this post

Link to post
Share on other sites
I found out my problem... I was doing that setup i said where
I render some meshes to a offscreen texrue, then use that to texture a quad.
Problem was I was using a statemanager (public ID3DXEffectStateManager) to set the
FVF and using the straight device to set Decl.
And since the statemanager class I have stores the last used
FVF, when it came time again for the statemanager to check the FVF it was the same
but internaly it was different because the statemanager didnt know about
the setDecl() call. So now I have to StateManager->SetFVF(0) before the SetDecl()
so it knows about the Decl change.

Thanks for help!

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