Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8246155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:24:46+00:00 2026-06-07T22:24:46+00:00

I’ve got a bit of a conundrum that is just flat out stumping me.

  • 0

I’ve got a bit of a conundrum that is just flat out stumping me. Let’s say i have a couple of shaders all with different vertex types like this:

// light shader
struct vertexInputType
{
    float4 position : POSITION;
    float2 tex : TEXCOORD0;
    float3 normal : NORMAL;
};

// color shader
struct vertexInputType
{
    float4 position : POSITION;
    float4 color : COLOR;
};

// bump mapping shader
struct vertexInputType
{
    float4 position : POSITION;
    float2 tex : TEXCOORD0;
    float3 normal : NORMAL;
    float3 binormal : BINORMAL;
    float3 tangent : TANGENT;
};

Now let’s say i have a model with all of this data available. I can’t exactly have it all be in the same buffer and render with all 3 as i choose because the data isn’t laid out correctly for all of them. I only see two options to make this possible, both of them just as painful.

1) i could have a big buffer in ram that holds all the data, and then every draw call, i grab from the shader object, the vertex type and create a new vertex buffer with the correct information. This, as you can see, would be HORRIBLY slow.

or…

2) i could create multiple ID3D11Buffers when the model is initialized, where one buffer has the position and color, one has position, texcoord, and normal, one has position, texcoord, normal, binormal, and tangent, and also as many buffers needed for any other vertex types the model has information for. This in comparison, obliterates your available vram, making this a nogo as well.

I can’t see any other way of doing this. How do you other d3d guys do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:24:47+00:00Added an answer on June 7, 2026 at 10:24 pm

    It’s a good thing you’re asking about this in a DX11 context – ID3D11InputLayout simplifies this concept a LOT from previous versions. You can use CreateInputLayout to create multiple layouts of your vertex data (one for each of the structs you’ve provided above) and call IASetInputLayout with the correct layout at the point(s) you want the same vertex buffer to be interpreted differently.

    Edit: Look here for an example of creating the Input-Layout object.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I know there's a lot of other questions out there that deal with this
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.