Closed terhechte closed 2 years ago
Did you compile with --release
?
I have some doubts if this is a bug or just a heavy unoptimized way to rendering a floor. So here are some things to keep in mind:
debug
mode, there are a lot of checks which is done, that in release
mode aren't (you can compile only Bevy dependencies in release
, by adding opt-level = 3
or a [profile.dev.package."*"]
section)With all being said, if you have made this previous work with other engine and it acted as you expected, that may be a bug in Bevy, but I don't expect any market engine to have a good performance under those conditions.
Note: I tried your conde on my machine and I got 0.1 FPS
@afonsolage I did try a release build before I submitted here, yes.
Good to know that debug printing will slow down the FPS. This is really the first time I'm using a game engine to do 3d stuff, so I wasn't sure about the limitations. I did try to recreate the scene in Godot but I gave up quickly because I found everything a tad unintuitive. The 1280 x 1280 was mostly for testing the limits, but even with 128 x 128 I had problems. However spawning planes instead of cubes does speed this up quite a bit. I'll try some more. Thanks!
Since it seems that it isn't a bug on Bevy, the issue will likely to be closed, but you may consider joining the Discord, so we may help you out with what you are trying to achieve.
Also, you can use the discussion tab on GitHub, that way, other users with experience in 3D rendering may help you also.
Will do, thanks
Bevy version
I tried:
0.8.1
bevy = { git = "https://github.com/TheRawMeatball/bevy", branch = "optimize-large-entity-counts" }
[Optional] Relevant system information
What you did
I'm trying to render something like a tiled floor in a 3d world. Initially I wanted to use a tiled texture, but I ran into this issue of tiled textures not working and the listed approaches somehow didn't work for me.
My next approach was to spawn a lot of cubes or planes instead. Here's the code:
What went wrong
The FPS goes down to ~35 when I spawn 128 x 128 cubes. Which is not a particularly large level size. It crawls to ~10 fps when I spawn 1280 x 1280 cubes. I also tried rendering with the high entity count PR, but that didn't really change much either. Now, I understand that 1280 x 1280 is quite a lot of entities, but wouldn't frustum culling do away with anything not visible? Also, even if tiling would work, constructing bigger levels with lots of floor texture changes would still quickly run into a high entity situation. So either I'm doing something wrong or something is really slow here.
Additional information
Other information that can be used to further reproduce or isolate the problem.