So, i when looking throught Roblox DevForum, i found some Interactive Grass modules and showcases. They were cool, but one thing that bothered me was performance. Most of the videos only showcased tiny amount of grass. So i decided to make my own Interactive Grass and try to optimize it as much as it is possible, so no matter how much grass you will have, it will still run smoothly. Right now the progress is pretty good.
You can see it here:
It runs at about 120-150 fps, but it is still just a test. I will try to optimize it even more.
When everything be done, i will probably open source it and give to the beloved roblox dev community.
But right now, what do you think about this? Does anybody know how i can improve it? Maybe give a idea or optimization tip. Thanks.
5 Likes
This looks very satisfying ! I like it a lot. Did you make this using editable meshes ?
And one thing that you could do to optimise it is only rendering grass that’s within a certain distance from the camera, like roblox’s grass does.
3 Likes
I didn’t use EditableMesh as it doesn’t have Bulk function, unlike BaseParts which do. So under Workspace there is function called BulkMoveTo() which i can use to calculate the grass positions in parallel, and then after leaving the parallel phase i can move all the grass using this single function. It makes it faster as during parallel phase i cannot move any Parts, and looping throught all of them again after parallel phase would make it run slower. But for EditableMesh there aren’t any Bulk functions (Yet). So making it run parallel would be a issue.
But when Roblox Releases Bulk functions for EditableMesh, i will probably try to rework this to use EditableMesh.
I hope you understood what i am saying as i am not very good at explaining things.
And as for making the grass far away not render, it is a good idea. I will try to implement that.
3 Likes
This interactive grass looks nice! Good job on it! How long did it take you to create the interactive grass?
2 Likes
I’m curious, whats the fps difference with and without the interactable grass?
2 Likes
I think it took around 3 hours. But in reality it took 3 days as i was developing around 1 hour every day.
When i disabled the code that simulates the grass, and only left the generated grass, i had about 240 fps which is max.