Jump to content
  • Advertisement
Sign in to follow this  
wil_

Vertex attributes default values ?

This topic is 1364 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

If I create a vertex buffer with data like this (code from DirectX SDK Tutorial07):

 

    SimpleVertex vertices[] =
    {
        { XMFLOAT3( -1.0f, 1.0f, -1.0f ), XMFLOAT2( 0.0f, 0.0f ) },
        { XMFLOAT3( 1.0f, 1.0f, -1.0f ), XMFLOAT2( 1.0f, 0.0f ) },
        { XMFLOAT3( 1.0f, 1.0f, 1.0f ), XMFLOAT2( 1.0f, 1.0f ) },
        { XMFLOAT3( -1.0f, 1.0f, 1.0f ), XMFLOAT2( 0.0f, 1.0f ) },
        // ... etc

    };

 

 

Bind it with this input layout:

 

    D3D11_INPUT_ELEMENT_DESC layout[] =
    {
        { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
    };

 

 

To this vertex shader input in the shader:

 

    struct VS_INPUT
    {
        float4 Pos : POSITION;
        float2 Tex : TEXCOORD0;
    };

 

 

Then is it guaranteed by D3D specification that the 4th component of the Pos attribute (Pos.w) in the shader will be 0.0 ?

 

I cannot find definitive information about it.

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

Ok, thanks for pointing me to relevant part of the documentation.

Edited by wil_

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!