Myjestic Posted April 6, 2016 Share Posted April 6, 2016 Hi, I have a strange problem. Please take a look at the following scene. If you turn around 180° from where you start in the scene, the frame rate will decrease drastically if you look to the nearest corner. Please do not ask why I did some of this thinks like in the source. I stripped my whole code to make the problem more clearly. Can anyone explain why the fps is decreasing and what line of code is responsible for this? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
RaananW Posted April 6, 2016 Share Posted April 6, 2016 Hi! I can't seem to notice any degrade in FPS. But I will ask questions You enabled physics. You have a single physics object (the plane), but no other objects are there to collide against it. are you trying to get the camera collision system to work? Quote Link to comment Share on other sites More sharing options...
Myjestic Posted April 6, 2016 Author Share Posted April 6, 2016 Yes I do some collision physics in my "project". I simplified everything that is not necessary to show the problem. Strange that you cannot notice the fps drop. I tried it with different browsers on different PC's. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 6, 2016 Share Posted April 6, 2016 Raanan... you need to turn the cam backwards... to aim at the nearest ground-corner. Then cursor toward it a bit. That's when I see a FPS-flop... a big one. BUT... this "ground" is made up of many cubes, merged together. I think there's physics trouble when doing that. Or, some other bog. Just possibly, our camera is plowing into a big pile of physics impostors that are stacked-up in that corner. The impostors begin colliding, but they are invisible, so we can't see them. But many impostors colliding = decreased frame rate. *shrug* Quote Link to comment Share on other sites More sharing options...
adam Posted April 6, 2016 Share Posted April 6, 2016 Weird. I'm not seeing the issue when I replace the emissive texture with an emissive color. http://www.babylonjs-playground.com/#1STPHI#1 Quote Link to comment Share on other sites More sharing options...
adam Posted April 6, 2016 Share Posted April 6, 2016 Just turn the camera around to see the drop in FPS. http://www.babylonjs-playground.com/#1STPHI#2 Quote Link to comment Share on other sites More sharing options...
adam Posted April 6, 2016 Share Posted April 6, 2016 I changed the instances to clones and use BABYLON.Mesh.MergeMeshes: http://www.babylonjs-playground.com/#1STPHI#3 I'm no longer seeing the fps drop. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
fenomas Posted April 7, 2016 Share Posted April 7, 2016 Wow, that's really weird. The slowness is coming from collision testing but it goes away if you disable emissive textures (or just all textures). Gotta be some kind of subtle engine bug? The slowness comes from: camera > _checkInputs > _processCollisionsForSubmeshes > _collideForSubmesh > _collide > _testTriangle Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 7, 2016 Share Posted April 7, 2016 It is not related to textures (based on my testing) but to collisions The camera is INSIDE the ground which means that the engine struggles to solve the collision equation on every frame (which is impossible as two objects cannot be at the same place). Just try to move your camera higher or reduce camera.ellipsoid Quote Link to comment Share on other sites More sharing options...
fenomas Posted April 7, 2016 Share Posted April 7, 2016 16 minutes ago, Deltakosh said: It is not related to textures (based on my testing) but to collisions Do you have any idea why the problem doesn't happen if you switch the scene to wireframe mode? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 7, 2016 Share Posted April 7, 2016 Good question There is something really odd here! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 7, 2016 Share Posted April 7, 2016 Actually even without collisions there is still another problem. You cannot merge instances. You have to clone instead. Else cache is completely broken and we have these subtle bugs all over the place Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 7, 2016 Share Posted April 7, 2016 Adam was right: http://www.babylonjs-playground.com/#1STPHI#3 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 7, 2016 Share Posted April 7, 2016 Cleaner PG for the record: http://www.babylonjs-playground.com/#1STPHI#5 Quote Link to comment Share on other sites More sharing options...
fenomas Posted April 7, 2016 Share Posted April 7, 2016 1 hour ago, Deltakosh said: You cannot merge instances. You have to clone instead. Else cache is completely broken and we have these subtle bugs all over the place The merge method could detect that and throw an error, right? (sorry, no PR from me I don't have typescript set up.) Quote Link to comment Share on other sites More sharing options...
Myjestic Posted April 7, 2016 Author Share Posted April 7, 2016 Thanks to all for dealing with this problem. 14 hours ago, fenomas said: Do you have any idea why the problem doesn't happen if you switch the scene to wireframe mode? It tested this and the problem appear even if you switch to wireframe mode. 18 hours ago, adam said: I changed the instances to clones and use BABYLON.Mesh.MergeMeshes: http://www.babylonjs-playground.com/#1STPHI#3 I'm no longer seeing the fps drop. You are right. This eleminates the fps drop. BABYLON.Mesh.MergeMeshes only works with clones not with instances. As far as I remember, Deltakosh wrote in another post, that merging instances is now possible. I will search for this post and read it again. Thanks so far. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Myjestic Posted April 7, 2016 Author Share Posted April 7, 2016 And here it is link to post Quote Link to comment Share on other sites More sharing options...
adam Posted April 7, 2016 Share Posted April 7, 2016 This framework is constantly being worked on. It is likely it was working back in November of 2015. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 8, 2016 Share Posted April 8, 2016 Yep I was wrong actually as instances use the same exact buffer as source, the merge is not possible Quote Link to comment Share on other sites More sharing options...
Myjestic Posted April 11, 2016 Author Share Posted April 11, 2016 On 8.4.2016 at 5:59 PM, Deltakosh said: Yep I was wrong actually as instances use the same exact buffer as source, the merge is not possible Okay. good to know. Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.