Custom polycount/detail level for 3D primitives

Avatar
  • updated
  • Completed

Being able to customize the polycount or detail level of 3D primitives would be useful when you need more control

This might seem like a straightforward thing, but, Shapes heavily relies on instancing to stay performant, and you can't instance things that use different meshes, and different polycount means different meshes

I've yet to fully design this but, here's what I'm thinking - each 3D primitive would have a detail level setting:

Detail Level

  • Low
  • Medium (this would be the same as the current ones)
  • High
  • Custom (this one would show a warning that this mesh won't be instanced)

The low/med/high ones are easy enough to implement, but the custom one has some implications

for instance, if you set a custom polycount on a torus, and you then duplicate this torus 50 times, you might expect them to use the same mesh and get instanced. but, a simple implementation means each would be using a unique mesh

it all boils down to a problem of asset management - do I keep a dictionary of detail levels and meshes and track usage? if so, are there performance overhead considerations I need to take into account? I also need to be absolutely sure this doesn't cause mesh asset leaks too

Another alternative I'm considering is to not allow per-instance custom detail levels, but rather, you can customize the low/med/high presets!

This solves the problem quite well, but it means you're limited to 3 detail levels per primitive per project. In most cases though, I think this would be fine (apart from the fact that it's fun to tweak detail levels and watch triangles go nyooom~)

although! this would also prevent stylistically choosing to make really low poly things, such as a cylinder with a detail level of 3 to make a triangular prism, or a hexagonal prism, etc.

anyway yeah, thinking about this!

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Completed

This has now been added to the upcoming version! (I think it'll be 2.4.0)

Avatar
Freya Holmér creator
  • Under Consideration
Avatar
Freya Holmér creator
  • Answer
  • Completed

This has now been added to the upcoming version! (I think it'll be 2.4.0)