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 7400221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:13:02+00:00 2026-05-29T04:13:02+00:00

If I have a few Program3D objects (each with it’s own Vertex-Shader and Fragment-Shader

  • 0

If I have a few Program3D objects (each with it’s own Vertex-Shader and Fragment-Shader responsible for it’s own rendering task), do I need to instantiate a new VertexBuffer3D and IndexBuffer3D so that they store the data only relevant to the vertex-data format used by their corresponding Program3D?

For example, if I was planning to define Quads in different vertex-data formats, such as:

var vertexData:Vector.<Number>;

//Vertex-Format A:
vertexData = new <Number>[
  //X, Y, U, V
  -.5, -.5, 0, 0,
  .5, -.5, 1, 0,
  .5, .5, 1, 1,
  -.5, .5, 0, 1
];

//Vertex-Format B:
vertexData = new <Number>[
  //X, Y, U, V, Matrix-Constant ID, Color
  -.5, -.5, 0, 0, 3, 0xff0000,
  .5, -.5, 1, 0 , 3, 0x00ff00,
  .5, .5, 1, 1,   3, 0x0000ff,
  -.5, .5, 0, 1,  3, 0xffff00
];

//Vertex-Format C:
vertexData = new <Number>[
  //X, Y, Matrix-Constant ID
  -.5, -.5, 3,
  .5, -.5, 3,
  .5, .5, 3,
  -.5, .5, 3
];

Would I need to create one VertexBuffer3D and IndexBuffer3D to store format A, another one for format B, and yet another one for format C? Or can the various formats be mixed inside the same VertexBuffer3D and then make some clever (or confusing!) use of a single IndexBuffer3D to draw the triangles?

  • 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-05-29T04:13:03+00:00Added an answer on May 29, 2026 at 4:13 am

    You can mix and match freely. Think of a vertex program needing all inputs hooked up to something. Where that is comming from is done with setVertexBufferAt. It can come from different buffer, it can come even from the same location. Just like connecting some wires. Index buffers just jump around in the vertex buffers. You can, and should, re-use them as much as possible.

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

Sidebar

Related Questions

I have written quite a few Ruby programs, but if I need to show
I have few asynchronous tasks running and I need to wait until at least
I'm writing a program consisting of dynamically created panels that each have a few
I'am using key-value observing. I have object_1 (NSManagedObject) and few other objects-observers. When I
I have inherited a few programs from a previous developer who was a little
We have a few different programs all compiled together in the same suite, recently
I have a few questions related: 1) Is possible to make my program change
I have a program that runs in a few threads. The main thread shares
I have few different applications among which I'd like to share a C# enum.
I have few question in this regard When you create an internet page, does

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.