Questions tagged [geometry-instancing]

51 questions
0
votes
0 answers

Updating instanced data with a compute shader

I can't get instanced geometry to work with a compute shader (I got both things work in isolation but don't know how to combine them). Below is an example that renders instances of a colored quad with different offsets. I'd like to be able to update…
0
votes
1 answer

How does the game Rust place Millions of Grass, Rocks, and Trees

Rust has millions and millions of grass, rocks, and trees instances across its maps, which get as big as 8km. Is that grass placed dynamically around the player at runtime? If so, is that done on the GPU somehow or using a shader? In my game, we use…
0
votes
0 answers

Opengl instanced batching

Is there a way of drawing an instanced buffer in sections/batches? Currently I am shoving all of my geometry into large vbos, generating a render script that batches models by shader/textures/atlases, then drawing by using glDrawElements with a…
chips
  • 160
  • 1
  • 10
0
votes
1 answer

OpenGL SSBO Instancing

Binding a SSBO and accessing it via gl_InstanceID seems to work but im getting these really strange position artifacts and im not sure where they are coming from. The way im generating the random positions is pretty standard and i also tested the…
0
votes
1 answer

How to get instancing to work in my OpenGL program?

https://pastebin.com/Dyv5JBFd I created an array of vertices for my cube. I'm trying to create 1000 cubes in a cube shape. I believe I'm not understanding when to generate and bind VAOs and VBOs. I don't know what information would help figure this…
Truth7442
  • 13
  • 3
0
votes
1 answer

Using vertex buffer instancing, how to dynamically change separate instance position?

I need to draw million cubes. Cubes has the same vertex array, but may have different scale/position/rotation. Important: they may change their position dynamically, after vertex buffer creation. Some of them should be connected by the line. So I…
Artur
  • 325
  • 2
  • 16
0
votes
1 answer

A-Frame: Geometry Caching / Registering new Geometry from GLTF

I'm hoping to get some help using geometry instancing with A-Frame. I was trying to figure out the bottleneck for my web app and after implementing pooling for physics objects being created in the scene, saw that the number of draw calls was…
Jack W
  • 23
  • 3
0
votes
0 answers

How can I use instancing to generate 2 single different texture?

For example, I have two transform matrix: WVP_Left and WVP_Right. Can I render geometry (like a rabbit) using instancing to generate left texture and right texture? The left texture should just have only one rabbit with the WVP_Left effect, and the…
Xin YANG
  • 81
  • 1
  • 9
0
votes
0 answers

Webgl shader attrib type not matched

I have a buffer like this use it in instancing of a curve geometry Distance: { numComponents: 1, data: new Uint8Array(0), type: gl.BYTE , // signed byte normalize: true, divisor: 1 } vertex shader is: #version 300…
mh-alahdadian
  • 353
  • 5
  • 21
0
votes
0 answers

Webgl2 instance draw using TWGL.js divisor error

I'm using Twgl.js library for using webgl2 I had a array like below and I was making buffers from it with createBufferInfoFromArrays and use drawObjectList with VAO to draw it but after I changed my array for using some unsigned byte values instead…
mh-alahdadian
  • 353
  • 5
  • 21
0
votes
0 answers

Improving framerate of instanced geometry scene

I'm rendering large amount (millions) of instanced geometry. The geometry itself is simple, a box without bottom face. The rendered scene is actually a 3D graph where boxes are lines (only 3 faces are rendered at a time using culling). When the…
Raven
  • 4,783
  • 8
  • 44
  • 75
0
votes
4 answers

Retrieving normal after rotating an instance model in HLSL

I begin to use the "instancied model" technique to draw my scene and I've got a problem with normal's vertex I give to HLSL the MATRIX ( rotation / scale / position ) to draw each instance of model but I can't obtain the good normal after rotate…
0
votes
0 answers

Unable to instance VAOs at multiple positions in OpenGL

I have created a VAO in OpenGL, comprised of a VBO (2 triangles), an array of indices and an array of positions. However instancing it does only show 1 item. Does it mean it sees all positions at 0,0,0? GLfloat *vertices=new GLfloat[18]; …
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
0
votes
1 answer

Reusing VBO for hardware instancing

Usually I try to separate mesh specific information (VBO/VAO) from instance specific information (transform, uniforms, etc). In this way parts of the code which manipulate instance info do not need to know anything about VBOs/VAOs, and…
glopes
  • 4,038
  • 3
  • 26
  • 29
0
votes
0 answers

Instancing in Three.JS

It might be me, as I'm not very experienced with Three.js, but the Three.js instancing example seems very vague. I thought BufferGeometries were automatically created from Geometries in the new Three.js, and I don't understand why a shader is being…
user1663544
  • 135
  • 1
  • 2
  • 10