Jump to content

decreasing fps in Corner of meshed plane / free camera


Myjestic
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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*

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...