"Too many fragment shader texture samplers" error on attempt to load tiled layer

Dear all!

I'm trying to integrate Cesium to my web application. Everything was fine until I tried to use TileMapServiceImageryProvider to load custom (to be more precise, WorldWind-friendly) BMNG tiled layer in EPSG:4326 of the following directory structure: zoomLevel > tileX > tileY.jpg. Each tile has 512x512 dimensions and number of tiles on level 0 is: 10 for X and 5 for Y (it ideally suits 2:1 proportion of GeographicTilingScheme). I get the following errors in JavaScript console:


Yes, the number of textures that can be attached to a single tile is limited by hardware. You can find the number for your hardware by visiting http://webglreport.com/ and looking at the “Max Texture Image Units” field under “Fragment Shader”.

We can work around this limit by rendering in multiple passes, but we haven’t done so yet. Even if we did, it would probably result in poor performance. A much better solution, whenever possible, is to ensure that your tiling scheme only has a few (4 or less) tiles at the root level. Is that possible in your case? In a pinch, you can simulate it. Write a custom imagery provider that loads the 10x5 tiles at the root level, and resamples them to progressively smaller tiles until there are only a few at the root.


Dear Kevin!

Thanks a lot for clear answer. I have 16 max texture image units so will look for possibility to convert a cache to 2x1 tiles at level 0. Probably I'll have a luck to find existing tools for that.

Thank you again. It was very helpful.