Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frustum culling + instacing #81

Open
sauron65 opened this issue Nov 11, 2021 · 5 comments
Open

frustum culling + instacing #81

sauron65 opened this issue Nov 11, 2021 · 5 comments

Comments

@sauron65
Copy link

to increase performance entities should be frustum culled and maybe instanced. ANGLE_instanced_arrays is supported in all modern browsers and you already have frustum culling functions

@Mist-Stego
Copy link

i don't exactly think that instancing entities would work due to the nature of JS (sorry if i am wrong about this), but if it does work it will give the rendering speed a boost.

yeah i think that willard should give the frustrum calls on the entities and then see if it goes south, if it does go south and it is causing blocks and entities to glitch/ crash , then reverting back to mixed frumstrum/normal calling for entities could be the only option.

@Willard21
Copy link
Owner

I don't think there's ever been over 10 players in a world at once. It's very unlikely that they affect performance since they're just blocks.

@Mist-Stego
Copy link

well, when I have been on willard.fun, then it does happen sometimes, maybe every 4 days or so.

really? won't it give at least a little bit of relief on the gpu and let others have 7-10 more frames every second?

@Willard21
Copy link
Owner

Definitely not 7-10 more FPS. The most you could hope for is maybe a 0.1% increase in framerate. Frustum culling actually uses about the same CPU time as just rendering them, but it would technically reduce the GPU load very very slightly. The load on the GPU for rendering 10 players is about the same as rendering about 10% of 1 chunk. I think even a Chromebook should be able to render 100 chunks at 60 FPS.

If you're not getting 60 FPS, it's most likely from your CPU not being able to update meshes fast enough when other players are building/mining.

If mobs are ever added, then I'll definitely look into better ways to render them, and add frustum culling, but it's not a priority just for players.

@Mist-Stego
Copy link

oh shi-

so basically, if I have 10 fps (not that I actually do) then it would basically mean that I would just have a 1 fps boost 🤣

my cpu can do that, but it may be a problem when worlds start hosting more than 40 players.

yeah, mobs will probably need to be frustum called due to how much data is used to animate and render them in a 3D space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants