Sign in to follow this  
wswqwps

Difference between D3DFVF_XYZW and D3DFVF_XYZRHW

Recommended Posts

Staffan E    536
Quote:
From the DXSDK Documentation
D3DFVF_XYZRHW - Vertex format includes the position of a transformed vertex. This flag cannot be used with the D3DFVF_XYZ or D3DFVF_NORMAL flags.
D3DFVF_XYZW - Vertex format contains transformed and clipped (x, y, z, w) data. ProcessVertices does not invoke the clipper, instead outputting data in clip coordinates. This constant is designed for, and can only be used with, the programmable vertex pipeline.

That should clarify the difference. Both are transformed coordinates but the latter are also clipped; i. e. one step further down the road to the screen.

Share this post


Link to post
Share on other sites
ET3D    810
Formats containing D3DFVF_XYZRHW will not pass through the vertex pipeline at all. D3DFVF_XYZW, on the other hand, will go through the vertex shader. It's essentially the same as an XYZ vertex but with a further component. I'm not sure what the comment in the D3DFVF docs page means, but it's probably specific to ProcessVertices.

Share this post


Link to post
Share on other sites
paic    645
D3DFVF_XYZRHW: Use that when you need to work in screenspace (in 2D, for example for UIs and stuff like that) The vertex shader / pipeline won't be applied to those vertices. Only the pixel shader / pipeline. x and y contain the x and y coordinate of the vertex in screenspace, and z and w contain the depth information (never remember how its stored)

D3DFVF_XYZW: Use that ONLY if you're using a vertex shader which needs a float4 as the POSITION input. This FVF code won't work with the fixed pipeline.


With the 3 answers, I think you've got your answer :) (although you didn't tell use why you need to know the difference :p)

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