swift502/Sketchbook

Extreme FPS slowdown?

Thundros opened this issue ยท 18 comments

Hi @swift502! Just thought I'd let you know that for some reason I'm getting a huge lag around some of either the terrain & / or the objects in the scene. Can you please fix this? I will Beta test it for you!

Thank You!

Yeah I'm also getting low fps around the triangulated terrain when I spawn some balls with the "f" key.
It probably has to do with physics. I take this as a test map, so it just tells us that we shouldn't use trimesh terrain collisions in Cannon (the physics engine) unless absolutely necessary.

I'll let you know if / when I update this, but it might be some time. ๐Ÿ™‚

@swift502 : It actually did it without having to spawn any balls at all.

@Thundros I had the same problem - in my case it was using of shadows. After I turned them off, castShadow = false the application began to work much faster.

@radziksh Is there a way to use shadows without it affecting the FPS?

Hello, @swift502 : Were you able to fix this? If not, can you fix this? Thanks!

@Thundros Not really, sorry.
I don't have performance issues so it's not a priority for me. We'd have to find the bottleneck first, and again, I'm not sure how to do that myself. It could be raycasting, it could be that I'm still using a naive physics broadphase, or most likely the trimesh collisions in Cannon simply aren't that optimised, which just means we shouldn't use trimesh physics unless absolutely necessary.

It's unfortunately not a priority for me now. Unless you want to take a shot at identifying the bottleneck yourself, it might take a while before I focus on this issue. I currently prioritize working on new features, whenever I find the time to work on this at all. ๐Ÿ™

PLEASE fix the lag. It's driving me crazy. And I would really like to use some of the features in my own demo.

@Thundros I'm welcoming PRs. If you can fix the slowdown I'll be happy to accept your contribution.
I'm sorry, like I said, I'm not experiencing major slow downs so it's not a priority for me right now.

Why is the FPS only 30? It should be 60.

I get 55-60 fps.

I have an NVidia GeForce GTX 960M. I get 25 - 30.

Hello?

Sir, I don't know what else to say.

  1. I don't have performance issues
  2. I can't afford to devote the little time I currently have to spend on this on something that's not a problem for me
  3. I don't know how to fix something I can't replicate

You're free to investigate the problem and try fixing it yourself. I'll be happy to accept your contribution.
No need to wait for me to fix things, that's the beauty of open source. And reversely, I have no obligation to help you. My project is MIT - it comes with no warranty.

So you don't want to devote time to all those people who have lower end graphics cards that can't afford top-notch computer tech, who actually would LOVE to test your software & possibly even use parts of it?

I wish I could, I can't. It's currently up to you to investigate the problem yourself, seeing as you're the only person who's able to replicate the "issue".
Should you happen to be able to fix the problem, I'll be happy to accept your contribution.

Few things that might help us solve this:

  • How much FPS do you get with shadows disabled?
  • Can you make a video showcasing the problem, where and under which specific circumstances it occurs?
  • Have you tried to identify the bottleneck? Is it rendering, physics or my logic?
  • Are you getting issues mainly "around some of either the terrain & / or the objects in the scene" or mainly from the shadows?
  • Is the performance consistently poor or randomly gets bad and then fine again?

Likely a performance issue with three.js, cannon.js, or most likely insufficient hardware capabilities.
But most importantly, the number of FPS shouldn't influence the behaviour of my application, so I don't really see this as an issue with my application.

Closing for now.

@Thundros One last shot in the dark.

A friend of mine had an idea, that it might just be that you're not launching your browser with your dedicated GPU, but rather the default integrated graphics of your CPU. I actually had to do this myself when I used to develop on a laptop. Can you try this and see if there's a difference?

image

q98 commented

I'd like to chime in here, I get 60 fps (50 at the lowest when navigating the polygon mountain) on a 2 core celeron notebook with 2 gigs of ram.

On my 2011 iMac I get 60 fps solid throughout.

Similar results on my gtx 1060ti