V1.42 GL errors in console. V1.41.0 is OK

kulodo133

https://playcanvas.com/project/804407/overview/new-fold-load-old-engine

Go to branch ā€˜originalā€™.

Thanks, will check later. Is there anything wrong with this order of actions in my sceneManager?

  1. currentScene.destroy();
  2. unloadAssetsForScene(currentSceneName
  3. loadAssetsForScene(newSceneName)
  4. this.app.scenes.loadSceneHierarchy(newScene.url
  5. this.app.scenes.loadSceneSettings(newScene.url

It seems fine. When I did:

  1. this.app.scenes.loadSceneHierarchy(newScene.url
  2. currentScene.destroy();
  3. this.app.scenes.loadSceneSettings(newScene.url

It seemed to load fine so Iā€™m not entirely sure where in the process this is breaking.

Are there assets shared between the two scenes?

iā€™m not sure, its possible, but I am pretty sure that my sceneManager will unload and load everything it needs. However, as you say, the error only occurs on scene change to that seems like a good place to start looking. The reason Iā€™m destroying the current scene first was , I think, to avoid a spike in VRAM usage during the scene change.

Got it down to a bare minimum scene, no scene loading. https://playcanvas.com/editor/scene/1177100

Ticket created: [.WebGL-0x47a8ea00]RENDER WARNING: there is no texture bound to the unit 0 - After Shadowmap refactor Ā· Issue #3236 Ā· playcanvas/engine Ā· GitHub

Thank you @yaustar. That really is bare minimum! Get in touch if you want me to test any fixes.

Looks like it is related to the position of the light relative to the camera. Your project moved the camera on the scene load which threw me off until I checked all the events hence I couldnā€™t make it happen just loading Room 6 or using my own scene loading code :sweat_smile:

1 Like

And the fix PR is here ā€¦ it should come out with the engine release, hopefully this week

1 Like

Hi I built the engine locally to try out the fix, and on my mac I can launch by adding the query
use_local_engine=http://localhost/~kulodo/Dev/PlayCanvas/engine/build/playcanvas.dbg.js.

But I wanted to test on iOS and Android also. The devices are on the same network as my Mac so the locally built engine is accessible if I use the ip address or the mymac.local instead of localhost. However it seems that in the use_local_engine parameter it really must be ā€œlocalhostā€, as anything else is ignored and the 1.42.0 stable version is loading from playcanvas. Is there a way to run my locally built engine on iOS and Android ?

Please use port forwarding in Chrome devtools Access local servers - Chrome Developers

1 Like

Unfortunately with the branch that has the error fix, My App on Android gives lots of ā€œFailed to compile Fragment shader: too many uniformā€ errors. The errors occur on entering ROOM 6.

mvaligursky-shadow-map-allocate
Powered by PlayCanvas 1.43.0-dev 748c16267

Thatā€™s interesting ā€¦ what other shadow casting lights are in the scene? Are there many others? Perhaps set as static or lightmapped or something?

I will check this evening UK time. Quick question though. As the ā€œtoo many uniformsā€ error occurs in your 1.43-dev branch but not in 1.42.0 or 1.41.2, does that mean that your 1.43.dev fix and future engine releases will cause more uniforms in the shader and therefore I must optimise the scene in this project, and maybe others? Sorry for the novice question.

@yaustar Is there are equivalent way to run my locally built engine on iOS?

No, thatā€™s not the plan at all ā€¦ the reason I ask is to find what is causing the problem and fixing it to not cause any impact.

1 Like

A couple of non great ways. You can use a network proxy like Charles which allows you to change responses to specific text/files.

Or you can upload the engine file to the project and set it to load after the engine. Not great for production or iteration but perhaps enough to test in this case.

Edit: if the fix has been merged to master, you can use the URL https://code.playcanvas.com/playcanvas-latest.dbg.js instead which is always latest on master

2 Likes

Ok I have another fix, which should fix this - it does my repro case of the same situation (11 shadow casting spot lights on android)

1 Like

Great thanks. Iā€™ll take a look this evening.