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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:17:53+00:00 2026-06-14T14:17:53+00:00

In a voxel game I’m making, I’m using VBO’s for rendering the world. I’

  • 0

In a voxel game I’m making, I’m using VBO’s for rendering the world. I’ use somthing like this to send the vertices to the GPU:

    FloatBuffer vertexData = BufferUtils.createFloatBuffer(..?);

    float[] vertices = new float[..?];

    //vertex calculations go here

    vertexData.put(vertices);
    vertexData.flip();

    //send the vertices
    int vboVertexHandle = glGenBuffers();
    glBindBuffer(GL_ARRAY_BUFFER, vboVertexHandle);
    glBufferData(GL_ARRAY_BUFFER, vertexData, GL_STATIC_DRAW);
    glBindBuffer(GL_ARRAY_BUFFER, 0);

However, the vertices are calculated dynamically, and there is no way to know how many I will be rendering beforehand. So I don’t know how much space to allocate to the FloatBuffer and to the array.

I thought using ArrayList’s but it seems slow and unefficient. Is there any way I can make an array or a FloatBuffer without specifying a size? Or sending the data to the GPU as the vertices are calculated, instead of sending them all in the end?

  • 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-14T14:17:54+00:00Added an answer on June 14, 2026 at 2:17 pm

    Is there any way I can make an array or a FloatBuffer without specifying a size?

    Why not just use an ArrayList to generate your data, copy the vertices into a FloatBuffer, and then use that?

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

Sidebar

Related Questions

In my (Minecraft-like) 3D voxel world, I want to smooth the shapes for more
I would like to render an animated voxel scene using WebGL and Three.js, for
I am making a voxel-based game, and for needs of it, i am creating
i am working on voxel based game engine, in which i need to have
I'm currently creating a neighbourhood graph by doing roughly this: for every voxel look
i'm planning on building a voxel editor (c++ and opengl) for personal use and
To make a lighting system for a voxel game, I need to specify a
In this 2010 paper [1] on raycasting sparse voxel octrees (SVOs) (apologies; the paper
Background: In our C++ game, we use wglUseFontBitmaps to display the character bitmaps on
I'm creating a minecraft like voxel engine thing in xna, and have started about

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.