Dropped frame rate

Hello, my frame rate is dropped from 15 to 5 after adding some trees object, i don’t think it’s the trees fault but it says it render over 900k triangles that’s a bit too much so i can just guess it’s the terrain fault, but the frame rate is not related to that. Anyone has some hint?
The 5 seals

Hi @ayrin,

900K triangles and 428 draw calls can be a lot, as I can see from the profiler. You should definitely decrease both if you are planning in shipping this to not so powerful hardware.

To isolate what part of your scene is mostly responsible for this you can enable/disable entities in editor and check your launch window with the profiler open (ALT + T).


you could also look at https://developer.playcanvas.com/en/user-manual/graphics/lighting/runtime-lightmaps/ - that could give you nicer shadows for non-moving objects, and better performance as they won’t be rendered to shadow maps every frame.

1 Like

Oh, the guides were updated! Nice :slight_smile:

Thanks @mvaligursky i used the auto-unwrap and enabled lightmap but i loose the textures of the models…why is that? and anyway the frame rate doesn’t change.

could be related to this issue, try workaround mentioned there please

I had a very quick look at profiling of the project. On CPU side, by far the largest part is running some simulation in wasm module - is that physics (ammo) or something custom? That takes around 70% of the frame.

Also, findByName is called per frame (few times?) and that’s not cheap.

Yes it’s ammo, i know i have to reduce the findByName calls.

@mvaligursky any idea why the ammo take so much resources? I don’t think i made something so draining, unless it’s the terrain.js code

35 fps with the old scripts…unfair lol

My best guess it is as it’s pretty large. How many polys is it? Have you chunked the different areas of the world or is it all loaded at once?

1 Like

More than 900k poly are rendered, different areas are lodaded separately by rebuilding the terrain by heightmaps and replacing the buildings and enabling/disabling entities… What bugs me more is the difference in frames by old scripts and new ones.

The scripts going from legacy to 2.0 shouldn’t make a difference though. Still the same code technically.

That’s a lot for physics to handle. Can you have a simplified mesh for the collision?

Yes, guess so, with some work i can use semplified meshes for buildings, for player and npcs i already have a capsule collision.

I was thinking more for the terrain.

Yes i guessed that too, the terrain use a 200/200 grid that’s halved for collision component, if i reduce it further, beside some sloop that will not match, objects will fall through (some of them already do that sometime)

Found out that in old version the triangles were around 400k, now it’s around 900k…no major changes…what the hell is happening?

old game new game

Noticed 3 cameras where enabled, disabled 2, but frame rate still very low, halved also terrain resolution
new game1