Questions tagged [gpu-instancing]

9 questions
2
votes
0 answers

GPU Instancing with multiple Materials

I'm making use of GPU Instancing in my 3D game in Unity. Currently I'm using single material for each mesh. But is there a way to do that with multiple material? I have mesh's with just material colors without any textures, so texture atlas not…
1
vote
1 answer

When drawing mesh instances on the GPU indirectly (no CPU involved), is it better to calculate transform matrices on CPU or GPU?

I am instancing tens of thousands of meshes on the GPU - each mesh needs to have a unique transform. Is it faster to calculate tens of thousands of matrices on the CPU and pass them to the GPU via a compute buffer, or is it faster to calculate each…
mikemeyers
  • 35
  • 4
1
vote
0 answers

multiDrawElementsInstancedWEBGL / select geometry to render using LOD

I'm looking for answer regarding the multiDrawElementsInstancedWEBGL api on the web, I'm hitting a wall on something and this is quite frustrating, and really afraid this could confirm my darkest fear haha I did some experiments in implementing…
1
vote
1 answer

DirectX 11 DrawInstanced render order

I'm just experimenting with rendering 2D sprites with DirectX11 using instancing. It seems that the primitive order matters when using "DrawInstanced". On the first try I tested with a couple of sprites (each with 4 vertices + texture data with…
Marc Klein
  • 13
  • 3
0
votes
2 answers

How to draw selected instances with gl_InstanceID and glDrawElements...?

I want to draw a selected number of instances using glDrawElements... but I don't know which function to use and how to set the parameters. I set the gl_InstanceID in shader and set the shader data through SSBO: glGenBuffers(1,…
KennyTan
  • 73
  • 1
  • 8
0
votes
0 answers

how to create mask Map to cull gpu instanced grass by DrawMeshInstancedIndirect on certain part of plane Unity

I found a git repository which instance grass using compute shader and DrawMeshInstancedIndirect in the camera frustum i am not able to figure out how to not instance grass on certain part of plane or say how to make instanced grass editable below…
0
votes
0 answers

GPU Instancing meshes appearing in scene view

What's the criteria for a GPU Instanced mesh to appear in the scene view? In my project I'm instancing grass and tree leaves with the GPU (through DrawMeshInstancedIndirect). The grass doesn't appear in the scene view but leaves do. If I had to…
Daniel
  • 7,357
  • 7
  • 32
  • 84
0
votes
0 answers

How can I scale the mesh used in DrawMeshInstancedIndirect

The question is pretty straightforward. I'm executing DrawMeshInstancedIndirect using Unity's default quad as the mesh. I want to know if it's possible to scale this mesh (so I can test the quality of the results with bigger and smaller mesh size)…
Daniel
  • 7,357
  • 7
  • 32
  • 84
0
votes
1 answer

Culling mask for GPU instanced mesh

My game has 2 cameras. I'm instancing a bunch of grass and I want the second camera to not render the grass. How can I do this? The grass is instanced via DrawMeshInstancedIndirect.
Daniel
  • 7,357
  • 7
  • 32
  • 84