Advanced Optimization Options?

For the sky, compress with ASTC instead of ETC. It uses a bit more VRAM but it’s a higher quality compression

1 Like

Quickie question about occlusion zones-- I am setting up some trigger volumes to turn on and off entities when they are occluded, BUT since I am using runtime baked lighting, if the scene starts with those entities unabled, they don’t receive lighting maps.

My workaround right now is to have all entities enabled at runtime, then occluded ones immediately turned off. But this may defeat some of the purpose at load, yes? Is there a less clunky solution?

When the entities are enabled, you will have to run ‘bake’ on the lightmapper again: Application | PlayCanvas API Reference

this.app.lightmapper.bake();

I think it’s better to bake everything at the start … otherwise you’ll get pauses during gameplay

All right, so for now I am sticking with having ALL entities enabled at start, then immediately disabled if occluded, once lightbake is done. This is the best practice?

I HAVE noticed one interesting thing (and I noticed this in previous builds as well): even without all this optimization in place, if I simply exclude the few largest sound files, the scene runs smoothly on all devices. Curious! Any way to address that?

1 Like

The sound files should not affect the performance. You could try creating an empty project with just those files and see if it runs on your device.

that’s really interesting, I agree that should have a very minimal impact. A repro of this would be good.

What happens if the sound is included? Does the scene run at all or does the framerate drop?

So currently I have two largish sound files: the wind sound and the jukebox. If I leave them in (one preloads, the other doesn’t) the scene instantly crashes on my devices, then it tries to load again, instantly crashes (straight out of the PlayCanvas loading screen without showing so much as a blip of content) then shows a default browser error message (this webpage repeatedly encountered problems, blah blah).

If I simply click “exclude” on those sound files (or even on the largest one, Jukebox) then the scene loads fine.

This has happened on previous scenes. The “Brass” scene once had a larger audio file in it that caused the same insta-crash. When I excluded it, it worked just fine.

If we are talking about the scene crashes, this is likely to do with the memory that the audio is decompressing into.

You may want to try playing the audio via a HTML DOM instead so you can stream it instead of having to decompress it all like we do in PlayCanvas. That should use less memory

1 Like

I was wondering about something like that I will look into how that works.