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

  • Home
  • SEARCH
  • 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 6344979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:44:18+00:00 2026-05-24T20:44:18+00:00

I’m creating an app using VBO to render some objects with difficult color structure.

  • 0

I’m creating an app using VBO to render some objects with difficult color structure. I noticed, that VBO defines the color of the element equal to last vertex index in the element buffer. For example, when I use point array like this

    double pointBuf[]={    -0.1d,  0.1d, 0,
                            0.1d,  0.1d, 0,
                            0.1d, -0.1d, 0};

color array:

    double colorBuf[] = {   0d, 1d, 0d,
                            0d, 1d, 0d, 
                            1d, 0d, 0d};

and element array:

   int elementBuf[] = {0, 1, 2}; 

to draw a triangle, it will be red (as the last element in elementBuf is 2, in colorBuf it matches red).

In fact it can lead to additional memory usage to paint everything correctly.

Is there any other possible way to link colors with elements?

  • 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-24T20:44:19+00:00Added an answer on May 24, 2026 at 8:44 pm

    One thing you need to understand is, that a vertex is not just its position. A vertex (in OpenGL terms) is the whole vector of attributes

    / pos_x        \
    | pos_y        |
    | pos_y        |
    | normal_x     |
    | normal_y     |
    | normal_z     |
    | color_r      |
    | color_g      |
    | color_b      |
    | color_a      |
    | texcoord0_s  |
    | texcoord0_t  |
    | texcoord0_r  |
    | texcoord0_q  |
    | texcoord1_s  |
    | texcoord1_t  |
    | texcoord1_r  |
    | texcoord1_q  |
    | …            |
    | texcoordN_s  |
    | texcoordN_t  |
    | texcoordN_r  |
    | texcoordN_q  |
    | …            |
    | attrib0      |
    | …            |
    \ attribM      /
    

    If you change any of these you end up with a completely different vertex. OpenGL’s data model has not been designed in a way that it were possible to place each of the attributes in a own array and address them with index vectors. Also this kind of data model would cause major difficulties in implement efficient caching, so would seriously degrade performance.

    Also you tell you’re running out of memory. Most modern systems offer you several gigabytes of graphics client (i.e. CPU) memory and at least a few hundred megabytes of graphics server (i.e. GPU) memory. The amount of geometry data (i.e. vertices) you can put into GPU memory exceeds the realtime processing capabilities of GPUs; also that would be far more vertices than pixels available on your screen. So I’m positive that you’re unlikely to run into any memory problems, your bottleneck will be/is another one.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
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

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.