bug?[GL] Shader program link log: Pixel shader sampler count exceeds MAX_TEXTURE_IMAGE_UNITS (16).

167 views
Skip to first unread message

Nian Li

unread,
Dec 5, 2013, 10:07:59 PM12/5/13
to cesiu...@googlegroups.com
hi team!

when I added about five layers and then add another layer  on 3D,there was a catch:[GL] Shader program link log: Pixel shader sampler count exceeds MAX_TEXTURE_IMAGE_UNITS (16).
but it is only six layers.

Nian Li

unread,
Dec 5, 2013, 10:09:08 PM12/5/13
to cesiu...@googlegroups.com
these layers are tile layers.

在 2013年12月6日星期五UTC+8上午11时07分59秒,Nian Li写道:

Kevin Ring

unread,
Dec 6, 2013, 9:31:05 AM12/6/13
to cesiu...@googlegroups.com
As the message implies, WebGL has a limit on the number of textures that can be used in a single draw call.  It guarantees that at least 8 are supported, and some hardware supports more, like yours with 16.  When your terrain and imagery tiling schemes are not aligned, a single imagery layer can end up requiring 2-3 textures.  Plus a couple of texture units are sometimes used for things like the water effect when you're using CesiumTerrainProvider.  So it's not surprising to get this message at around 6 layers.

It's possible for us to work around this WebGL limitation within Cesium, by breaking a tile into multiple draw calls when necessary.  But this comes at a significant cost of complexity and performance.  At 6 overlapping layers, you're probably already starting to see some slowdown anyway.  A much better solution is to combine some or all of your layers on the server side.

Kevin


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Nian Li

unread,
Dec 6, 2013, 8:20:59 PM12/6/13
to cesiu...@googlegroups.com
Kevin:
thanks very much.and I will test the server side ,if fine,our team maybe use this engine.
        thanks,
        leenian
在 2013年12月6日星期五UTC+8下午10时31分05秒,Kevin Ring写道:

Nian Li

unread,
Dec 9, 2013, 2:45:55 AM12/9/13
to cesiu...@googlegroups.com
hi Kevin:
   I get a solution using a temp canvas that when all images ready then for(var i,len =imgs.length;i++){ cxt.drawImage()..}

在 2013年12月6日星期五UTC+8上午11时07分59秒,Nian Li写道:
Reply all
Reply to author
Forward
0 new messages