Comparison of instancing, bufferGeometry, and interleavedBuffer in rendering techniques

I have a requirement to create numerous points and lines with position, size, and color attributes, and their positions are dynamic as they can be interactively dragged.

Up until now, I have been using buffer Geometry, but recently I came across two other options:

  1. instancing
  2. interleaved buffer

I am curious to know what these are and how they function. What advantages and disadvantages do they hold? Would they be more suitable for my project or is sticking with simple buffer Geometry the best approach?

Could you provide me with a detailed comparison of these three methods?

Answer №1

Interleaving involves consolidating data into a single VBO instead of using multiple buffers. By mixing the data together within one buffer, you can combine attributes like vertex positions and colors into a single stream, improving efficiency with different pointers for each type of data.

The advantages and potential drawbacks of this technique are still unclear to me, and I am seeking insights from more experienced individuals. It is uncertain how mixing types, such as adjusting precision for texture coordinates, would impact performance or if it is considered best practice.

However, one downside could be complicating loops that update specific attributes like positions without affecting others, such as colors, due to the interleaved nature of the data.


Instancing refers to utilizing a single attribute across multiple instances of geometry.

For example, you could define a cube with 24 vertices in one attribute, along with corresponding normals and indices. To position these cubes individually, you can manipulate a uniform variable that modifies the position attribute accordingly.

If you want to render numerous instances of a cube at unique positions, you can issue draw calls with the same attributes but vary the position uniform each time to achieve the desired placement.

To optimize rendering multiple instances efficiently, you can introduce an instance attribute containing positions for each individual instance, allowing you to draw all instances simultaneously within a single call. This eliminates the need for position uniforms and introduces additional attributes for managing complex instances like turning points into cubes.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to incorporate markdown files as strings in Next.js

Is there a way to bring in markdown files as strings in Next.js for use on both the client and server sides? ...

Is it possible to transfer an image from the client to the NodeJS server and store it locally within the server itself?

Is there a way for me to upload an image from the client side, send it via an HTTP request (POST) to the server (NodeJS), and save it internally on the server? Whether using Jquery, XMLHttpRequest, or a form, I continue to face the same issue where I can& ...

Could not load ngx-restangular due to an error: (SystemJS) Module not yet loaded while trying to load "@angular/core"

Recently, I made the switch from using the AngularJS 'restangular' library to the Angular 'ngx-restangular' library during an upgrade from AngularJS to Angular. However, after the transition, I encountered an unexpected error along wit ...

Obtain the data stored in an object within an array

I am attempting to retrieve the values of objects within an array. const bugSchema = new Schema({ title: { type: String, required: true }, comments:[ { user:{ type: String, required: true }, c ...

In JavaScript, apply a red color style to an appended list item every third time it is added

It should be something like this: <ul id="list"> <li>1</li> <li>2</li> <li style="color: red;">3</li> <- Text should be red ... <li style="color: red;">6</li> <- red ...

switching the content of a button when it is clicked

I am currently using Angular 7 and I am trying to achieve a functionality where the text on a button changes every time it is clicked, toggling between 'login' and 'logout'. Below is the code snippet I have been working on: typescript ...

Determine the HTTP status code for a request using Vue.js and Ajax

I need to retrieve the HTTP status code after submitting a form (using the form submission function): return fetch(serviceUrl + 'Collect', { method: "POST", headers: new Headers({ "Content-Type": "application/json", Authoriza ...

Using AngularJS to automatically fill checkboxes during editing

Transitioning from server-side operations to AngularJS for real-time functionality is a new challenge I'm taking on. With a user who can have multiple permissions, I'm facing an issue when it comes to repopulating checkboxes for permission chang ...

Developing and integrating views within a node-webkit desktop application

For my file copier desktop application built with node webkit, I aim to create a seamless flow where the initial check for existing profile data determines the first page displayed. The header with static links/buttons to various views remains consistent ...

In my Next.js project, I am looking for a way to make a modal continue to stay

I am looking to implement a feature where the modal remains visible even after a website refresh. Currently, when a user logs out, the page refreshes and the modal displaying "sign-out successful" disappears. My goal is to have the modal reappear after t ...

How can I position two divs side by side within an Appbar?

I would like the entire Container to be in a single row, with the Typography centered as it already is, and the toggle-container to float to the right <AppBar className={styles.AppBar}> <Toolbar> <Container> ...

Once an item is added, the table vanishes into thin air

I have a DataTables setup to show a list of project names, and I have a button that should add an item to the displayed array. However, when I click the button, the table disappears. Below is the code snippet: view.html <button ng-click="vm.add()"> ...

Tips on showing a success notification following form submission in HTML

I have crafted this code utilizing a combination of bootstrap, python, and html. I have omitted the css portion for brevity, but I can certainly provide it if necessary. My aim is to be able to send an email using smtplib and flask, with the added function ...

Sending data to another page by selecting a list item

Being new to web programming and JavaScript, I am facing a scenario where I have a list of requests displayed on one page and I need to pass the ID of the selected request to another page to display all the details of that particular request. I am strugg ...

React default class name ... Before conditional operator takes effect

import './App.css' import {Button} from "antd" <Button shape="round" className={ istrue === "itstrue" ? "trueclass" : "trueclass active" } > TEXT </Button> ...

In which situations is it required to specify the return type of a function in TypeScript?

When it comes to making functions in typescript, the language can often infer the return type automatically. Take for instance this basic function: function calculateProduct(x: number, y: number) { return x * y; } However, there are scenarios where dec ...

Change the websocket origin to localhost in a javascript setting

My server is hosting the domain example.com. Every time a user loads a page on this server, it utilizes a WebSocket client in JavaScript to connect to another WebSocket server. However, the other server has CORS enabled, which prevents the connection bec ...

Can one verify if an Angular application currently has active app modules running?

I am developing a unique plugin for Angular that is designed to automatically initialize an Angular app module if none are found. However, if there is already a running or declared ng-app, my plugin will utilize that existing module instead. Here is an i ...

Submitting a form automatically in React Native using Redux

Is there a way to automatically submit a Redux Form in React Native based on certain conditions being met? I attempted to do so below, but it resulted in a warning. The documentation provides an example for remote submitting, but it uses HTML form's ...

combine 2 documents

Two HTML files are on my hands. Both of these HTML files need to be combined. Is there a method in JavaScript or Jquery that can merge two files into one? I have looked at the append and other functions in Jquery, but I am dealing with two large files. ...