Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Streamed Date in DirectX

This topic is 6003 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi In OpenGL there are two ways to store data: Interleaved: Vertex1, Color1, Tex1, Vertex2, Color2, Tex2, ... Streamed: Vertex1, Vertex2, ... Coor1, Color2, ... Tex1, Tex2, ... DirectX uses the FVF which is like interleaved data in OpenGL. Is there a way to do it with streamed data to in DirectX? Or which format is chosen by other independent 3d engines? Have fun Bunnz Visit: www.bunnz.com

Share this post

Link to post
Share on other sites
Method 1 (Best - what OGL does - assuming hardware support):


IIRC you set up a vertex shader *declaration* to tell D3D/the chip which component is coming in which DMA stream. You don''t actually need to setup a vertex shader itself, you still pass the FVF to SetVertexShader().

For this to work with hardware vertex processing you need to have DX8 level drivers and T&L hardware. The GeForce2 Ultra for example supports 16 different vertex streams in DX8.

Method 2:

Use the stride parameter on Draw*PrimitiveUP(). Generally method 1 is the most preferable though since a) the UP method does an extra data copy to "safe" memory, and b) D3D/the driver will actually reassemble from the streamed format into interleaved format. Only use this method in extreme circumstances such as when you aren''t on DX8 level drivers.

Incidentally, checking the caps for the number of supported streams is the best method to check whether the driver is DX8 level or not (if the max streams is 0, then the driver is pre-DX8). A non-T&L card may report that it can do 1 stream, but since you''ll be using software VP in that case you can do as many as you require.

Simon O''''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!