Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

With Vertex Declaration If i want the Position and texture Coordinants only,

Dim PT() As VertexElement = {New VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0), _

New VertexElement(0, 12, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0), VertexElement.VertexDeclarationEnd}

PositionTexture.VDec = New VertexDeclaration(D3d.Device, PT)

If I want to Pass a Vertex Buffer thats got Position NOrmal And Texture Elements to the vertex Shader do i need to create a new Declaration?

if i pass a position only Vertex buffer?

Posted
You'll have to create a new vertex declaration as the presence of normal will change the offset of the texture information from 12 to 24. The same for position only (here you don't even have en element for texture coordinates).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...