I’m getting the the following error:
TypeError: Failed to execute ‘shaderSource’ on ‘WebGLRenderingContext’: parameter 1 is not of type ‘WebGLShader’.
when I try to run an app that uses multiple Cesium Viewers in one browser tab. I’m on Cesium 1.35 using Google Chrome.
I also get this warning printed to Chrome’s console:
WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost
Is this an issue with my code, with Cesium, or with my computer’s graphics capabilities? Thanks
It’s hard to say, context loss sometimes occurs due to out-of-memory situations. Does the problem happen if the Cesium Viewers just show the globe (no entities/ 3D Tiles/ etc)?
No, it doesn’t. It only happens when there are tiles and entities. If it is an out-of-memory problem, does that suggest that my program is leaking memory or that Chrome all the rendering I’m trying to have it do?
I doubt it’s a memory leak, the GPU is probably just overloaded. Are you rendering a 3D Tiles tileset in each view? The following advice applies just to 3D Tiles, otherwise ignore.
The amount of GPU memory used by each tileset can be controlled by tileset.maximumMemoryUsage, which is 512 MB by default. As of now we don’t track memory usage globally, so try just setting this value to a lower number. Another thing that might help is increasing tileset.maximumScreenSpaceError which will reduce quality but render less tiles.
Yes, I am rendering a 3D Tiles tileset in each viewer. I will try those suggestions. Thanks so much.