Skip to main content
GameDev.net gamedev.net
🔒 Locked

SetVertexDeclaration or SetFVF?

Started by xsirxx Apr 19, 2005 at 5:09 PM 2 replies 4.9k views
Original Post
xsirxx
xsirxx
Im currently working on deferred shading and I ran across SetVertexDeclaration(...) from nvidias samples. I currently use SetFVF(...). Whats the difference and why would someone prefer one over the other? Or are they completely different things? Thanks much --Brad
--X
Illco
Illco
SetFVF() is the old way and SetVertexDeclaration() is the new way. The latter can do all of the first but not vice versa. Using vertex declarations you can control more directly how your vertices are built up and, most importantly, interpreted by shaders.

Greetz,

Illco
xsirxx
xsirxx
What is new about it? What advantages does it have?
--X
superpig
superpig
With a vertex decl, you can completely control:
* The order in which parts of your vertex are laid out
* The streams that each part of the vertex should be taken from
* The data format of each part of the vertex (useful for compressing vertex structures down)

FVF codes, by comparison, require each piece of information to be a specific type, and requires them in a particular order. And to the best of my knowledge, will only let you sample from stream 0.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.