Skinned Meshes to Reduce Instance Count

Hii

TLDR: Can skinned meshes be used to replace a high number of instances.

I have a realtime tree/rock/etc generation system, with a fairly high render distance [8192 studs].
I’ve done my best to optimise it using a number of methods, but there is about 20k instances in the most dense regions.

Q1: Instead of using an instance per tree, could I instead use a skinned mesh containing roughly 40 trees, and position their bones so they appear as single instances?

I’m aware this could break clusters [which weren’t working well anyway :p] and collisions.

Q2: Are there any other considerations or bugs that might occur?

Thanks yall!

Edit: should probably say, I could test this myself, but it would require an intensive rewrite of the system.

2 Likes

You probably could use skinned meshes and just position their bones around. However this sort of method will also offer you like 0 power to actually interact in any meaningful way with the trees. Along with the skinned meshes being able to do so much before you’re just working with a grid of trees in a single mesh. You could probably get something actually working with that but again, roblox itself may not act a little weird with that setup but about this im not entirely sure.

Some things im more sure about that i can tell you that also aren’t exactly a solution to your exact problem (but you probably also know off already) is to just kinda use lower poly to straight low res pngs of the far away trees and just switch around them based on your distance to them.

1 Like

So ya think its feasible? ^^
Already I’m unable to interact with the trees as they are SpecialMeshes, this allows me to quickly switch between low poly trees and very low poly trees.

Well i mean sure go ahead! If that’s the case then im guessing there isn’t a lot for you to lose in this situation! You could perhaps even document such attempt at instance optimizations even!

1 Like

Was thinking of that! ^^ Would be interesting to share the results
Big ups dude! :>

1 Like

I decided to test this myself and the results are promising! =3

Summary

For my purposes, grid trees are far more performant. They benefit from higher performance while spawning, idling, and removing. I would recommend using the place [see bottom] to customize the test to better meet your usage requirements.

Using traditional MeshPart Trees, and Skinned Mesh grids of 49 Trees each, 9800 trees were spawned.

By positioning bones on the tree grid, trees can be made to appear as single instances.
This proves more efficient than using individual instances.

Here are the results of testing 9800 trees

Test Results
SPAWNING FPS AVG FPS LOW MEM AVG [MB] MEM LOW [MB] MEM HIGH [MB] TOTAL TIME [s]
INDIVIDUAL N/A N/A N/A N/A N/A 0.186092854
GRID N/A N/A N/A N/A N/A 0.074466228
IDLE FPS AVG FPS LOW MEM AVG [MB] MEM LOW [MB] MEM HIGH [MB] TOTAL TIME [s]
INDIVIDUAL 57.1 3.3 2613 2596 2614 N/A
GRID 58.4 13.2 2619 2610 2632 N/A
DELETION FPS AVG FPS LOW MEM AVG [MB] MEM LOW [MB] MEM HIGH [MB] TOTAL TIME [s]
INDIVIDUAL N/A N/A N/A N/A N/A 0.216387987
GRID N/A N/A N/A N/A N/A 0.036320209

Considerations

  • Trees in grid cannot be collided with or raycasted.
  • Skinned meshes do not benefit from clustering [I think].
  • Trees in grid spawn gradually, this can be seen in the test place.

Please customize the test to your own requirements. I am using low poly meshes with vertex colors

Here’s the test place, gl yall! ^^

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.