Forum Discussion
munter
10 years agoHonored Guest
Frame Rate Problem using lots of objects - please help!
Hi guys,
Basically I am wanting to plot the positions of the 100,000 closest stars with their colours and relative sizes and be able to fly around them, however I am encountering some framerate issues.
Each star I plot is just a spherical game object. When I plot 10,000 stars the framerate drops to around 30fps whenever I look into the distance and have around 5000 objects onscreen. Plotting 100,000 completely kills the game and is unplayable.
I have tried spacing the stars further away from each other but this doesn't help too much. I could also cut the rendering distance - I am not sure how to do this and part of the appeal is to be able to see lots of stars at once.
Does anyone have any advice on how to keep the framerate high? Is there a more efficient way of plotting these instead of using 100,000 separate game objects?
Thanks in advance.
Basically I am wanting to plot the positions of the 100,000 closest stars with their colours and relative sizes and be able to fly around them, however I am encountering some framerate issues.
Each star I plot is just a spherical game object. When I plot 10,000 stars the framerate drops to around 30fps whenever I look into the distance and have around 5000 objects onscreen. Plotting 100,000 completely kills the game and is unplayable.
I have tried spacing the stars further away from each other but this doesn't help too much. I could also cut the rendering distance - I am not sure how to do this and part of the appeal is to be able to see lots of stars at once.
Does anyone have any advice on how to keep the framerate high? Is there a more efficient way of plotting these instead of using 100,000 separate game objects?
Thanks in advance.
5 Replies
Replies have been turned off for this discussion
- cyberealityGrand Champion100k gameobjects will kill performance, even if they are untextured cubes. Even 10k may be a lot.
You can look into instancing, which may help. This is most useful if the objects can share materials.
Also, if there is not any animation of the stars, you can combine all of them into a static mesh. This should be a pretty big win, though you'll still have to watch out for poly count if the objects are detailed. - munterHonored GuestGreat. I will give this a shot and get back to you with my results.
- wheatgrinderExploreralso shadows... shadows kill
just thinking about this.. no idea if it works.. but..
maybe its more efficient to plot 10,000 simple low res sprites at those positions and when the player moves close enough to be able to perceive a sphere, replace the sprite with a sphere object. - munterHonored Guest
"cybereality" wrote:
100k gameobjects will kill performance, even if they are untextured cubes. Even 10k may be a lot.
You can look into instancing, which may help. This is most useful if the objects can share materials.
Also, if there is not any animation of the stars, you can combine all of them into a static mesh. This should be a pretty big win, though you'll still have to watch out for poly count if the objects are detailed.
Hey so I successfully combined all object into a few combined mesh chunks and the framerate is now fine even with 100k objects. However the drawback is that it takes 30 minutes to load the game... I think this is because the script has to create 100k game objects before the scene starts and then combine them into combined meshes.
Any suggestions to progress? - wheatgrinderExplorerIv enjoyed learning about this topic from your posts.
Have you considered creating your large 100,000 item mesh in a 3d modeling application such as blender?
Alternatively there might be ways to WRITE the resulting combined mesh to disk in Unity so that you only have to do the combine operation once on you dev system and load it as a single mesh thereafter.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 2 years ago
- 2 years ago
- 5 months ago
- 4 years ago