Quantcast
Channel: directxtk Wiki Rss Feed
Viewing all articles
Browse latest Browse all 874

Updated Wiki: VertexTypes

$
0
0
The VertexTypes.h header defines these commonly used vertex data structures:
  • VertexPositionColor
  • VertexPositionTexture
  • VertexPositionNormal
  • VertexPositionColorTexture
  • VertexPositionNormalColor
  • VertexPositionNormalTexture
  • VertexPositionNormalColorTexture

Each type also provides a D3D11_INPUT_ELEMENT_DESC array which can be used to create a matching input layout, for example:

device->CreateInputLayout(VertexPositionColorTexture::InputElements,
                          VertexPositionColorTexture::InputElementCount,
                          vertexShaderCode, vertexShaderCodeSize,
                          &inputLayout);

Usage

Position (which uses the semantic "SV_Position" is required for all rendering.

Normal is required for any Effect that supports lighting computations.

Note that Position, Normal, and Color are XMFLOAT3 (DXGI_R32G32B32_FLOAT).

Texture is XMFLOAT2 (DXGI_FORMAT_R32G32_FLOAT).

Viewing all articles
Browse latest Browse all 874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>