Advise Needed On Additional Geometry

I have several different instanced individual meshes, all using the same cube mesh but with different scales. You can think of it as a blocky world.

I wish to add “studs” similar to a LEGO brick at the top surface of each of these blocks, but I need advise on efficient approaches. Here are some ideas I have in mind:

  • Create one stud as a Mesh Renderer then instance it across each block such that it tiles on the top surface. Each individual stud can also have LOD such that it disappears on far distances.
  • Create a shader that adds the additional stud geometry to the bricks at the Geometry Stage aka a Geometry Shader. An important question to this is also if it will break the GPU instancing…

Some additional information:

  • My meshes need to be GPU instanced as each brick can change dimensions or position at run-time, so static batching is not an option and dynamic batching does not scale well.
  • My target platforms are computers and high-end laptops, so I can afford a greater polygon count, which is why I would ideally like to use geometry instead of texture / normal maps.

Any advise or opinion will be greatly appreciated.

There are examples of Lego geometry shaders out there. This thread would indicate that instancing on geometry shaders is possible, so this might be an interesting first thing to try:

1 Like

Thanks a lot James, I shall give it a try.

1 Like