Salman Posted January 11, 2021 Share Posted January 11, 2021 Hi! I'm working on a project where I have a Map scene. I remove and add this scene to the phaser game a lot because I have to populate map depending upon the data I provide to this scene. After updating the map many times, it just vanishes and doesn't render and it happens randomly. I'm creating some images and texts in the map scene that change depending upon the data I pass in Init function of the scene. this.game.scene.remove('map'); let map = new Map(); this.game.scene.add('map',map,isLoaderComplete,mapData); I'm also attaching a screen shot. Any help would be much appreciated, Thanks! Link to comment Share on other sites More sharing options...
totor Posted January 13, 2021 Share Posted January 13, 2021 iirc the number of webgl contexts is a browser limitation so if you create one each time you change the map you reach the limit and trigger the warning. Usually, you create one webgl context and then reuse it. Link to comment Share on other sites More sharing options...
Salman Posted January 13, 2021 Author Share Posted January 13, 2021 @totor I don't think I'm creating any webgl context. I just add and remove scene from the Phaser game. I don't destroy even Phaser game. So there must be something else. Link to comment Share on other sites More sharing options...
totor Posted January 14, 2021 Share Posted January 14, 2021 Did you test it on another computer / browser? Do you have many tabs with a glcontext? you provide not enough information to know. Link to comment Share on other sites More sharing options...
Salman Posted January 14, 2021 Author Share Posted January 14, 2021 @totor Yes I have tested on firefox, sfari and chrome. What do you mean by many tabs with a glcontext? Link to comment Share on other sites More sharing options...
totor Posted January 18, 2021 Share Posted January 18, 2021 The number of simultaneous webgl contexts is limited by browser so if you have multiple tabs open with a webgl context or a page with multiple webgl contexts they addup. Or you graphic card is limited, i don"t know ; post a demo or your code somewhere so people can test on their machine Link to comment Share on other sites More sharing options...
Recommended Posts