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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:46:32+00:00 2026-06-11T21:46:32+00:00

OpenGL 3 Render points: The points are stored within a space partition tree. The

  • 0

OpenGL 3 Render points: The points are stored within a space partition tree. The tree has points with colour and normal information attributes.

The point information and its attributes is stored as a set of buffers.

  1. An offset buffer is a vector array.

  2. The points are stored in memory as a center and offset index. The offset index points to the offset buffer Point = center + OffSetBuffer[offset index].

  3. Normals is stored in a normal buffer and each point holds an index of the normal buffer.

  4. Colour is stored in a colour buffer and each point holds an index of the colour buffer.

I have some room to change the buffer layout but holding information as above reduce repetitive or redundant information.

My question is how do I render the above Points using OpenGL 3+ APIs efficiently?

  • 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-11T21:46:33+00:00Added an answer on June 11, 2026 at 9:46 pm

    You don’t need additional offset buffer and offset index, just pass the textures coords. Here is what you should do in a vertex program:

    1) Calculate the particle basis from the ModelView matrix:

    vec3 X = vec3(ModelView[0][0], ModelView[1][0], ModelView[2][0]);
    vec3 Y = vec3(ModelView[0][1], ModelView[1][1], ModelView[2][1]);
    

    2) Calculate corner points based on particle size (can be uniform or attribute):

       vec3 A1 = -X*SizeX - Y*SizeY;
       vec3 B1 =  X*SizeX - Y*SizeY;
       vec3 C1 =  X*SizeX + Y*SizeY;
       vec3 D1 = -X*SizeX + Y*SizeY;
    

    3) Move the center point into the appropriate corner:

       if (TexCoord == vec2(0.0, 0.0)) Position += A1;
       if (TexCoord == vec2(1.0, 0.0)) Position += B1;
       if (TexCoord == vec2(1.0, 1.0)) Position += C1;
       if (TexCoord == vec2(0.0, 1.0)) Position += D1;
    

    or more efficient branchless code:

    vec3 O1 = ( 1.0 - TexCoord.y ) * ( A1 * ( 1.0 - TexCoord.x ) + B1 * TexCoord.x );
    vec3 O2 = TexCoord.y * ( C1 * TexCoord.x + D1 * (1.0 - TexCoord.x ) );
    Position += O1 + O2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I attempted to render a circle in opengl es 1.1 as a test before
How can I render mathematical notations / expressions in Python with OpenGL? I'm actually
I'm creating a very render expensive scene in opengl (using vertex buffer objects) and
How can I render a bunch of hand drawn shapes in opengl 1.x? I
I've been working on improving my OpenGL ES 2.0 render performance by introducing batching;
In order to do object picking in OpenGL, do I really have to render
In OpenGL superbible 4th ed, an example on pg 70 reads //returns space-delimited names
I want to implement a function with OpenGL to render a cylinder in C++.
I have seen metal/plastic/water/fire/... shaders for OpenGL. However, it it possible to render something
I'm writing some code which is intended to: 1. Render into an OpenGL texture

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.