Program failed to link

Hello,I’m trying to use Cesium to display more than two image layers.The code is as follows:

var layers = cesiumWidget.centralBody.imageryLayerCollection;

var layer = new ImageryLayer(new OpenStreetMapImageryProvider({

url :“http://202.197.18.12/hiart2/15225/

}));

layers.add(layer);

But when I added more than three layers continiously in this way, the system went wrong, the error Cesium provide is as follows:

An error occurred while rendering. Rendering has stopped.

RuntimeError: Program failed to link. Link log: error X4510: maximum number of samplers exceeded. ps_3_0 target can have a maximum of 16 samplers

Warning: D3D shader compilation failed with default flags. Retrying with avoid flow control.

error X4510: maximum number of samplers exceeded. ps_3_0 target can have a maximum of 16 samplers

Warning: D3D shader compilation failed with avoid flow control flags. Retrying with prefer flow control.

error X4510: maximum number of samplers exceeded. ps_3_0 target can have a maximum of 16 samplers

Warning: D3D shader compilation failed with prefer flow control flags.

Error

at new RuntimeError (http://202.197.18.14:8081/online3/pages/earth/js/Source/Core/RuntimeError.js:40:19)

at createAndLinkProgram (http://202.197.18.14:8081/online3/pages/earth/js/Source/Renderer/ShaderProgram.js:914:19)

at new ShaderProgram (http://202.197.18.14:8081/online3/pages/earth/js/Source/Renderer/ShaderProgram.js:612:23)

at Context.createShaderProgram (http://202.197.18.14:8081/online3/pages/earth/js/Source/Renderer/Context.js:1171:16)

at ShaderCache.getShaderProgram (http://202.197.18.14:8081/online3/pages/earth/js/Source/Renderer/ShaderCache.js:75:36)

at CentralBodySurfaceShaderSet.getShaderProgram (http://202.197.18.14:8081/online3/pages/earth/js/Source/Scene/CentralBodySurfaceShaderSet.js:103:47)

at createRenderCommandsForSelectedTiles (http://202.197.18.14:8081/online3/pages/earth/js/Source/Scene/CentralBodySurface.js:994:55)

at CentralBodySurface.update (http://202.197.18.14:8081/online3/pages/earth/js/Source/Scene/CentralBodySurface.js:132:9)

at CentralBody.update (http://202.197.18.14:8081/online3/pages/earth/js/Source/Scene/CentralBody.js:779:27)

at CompositePrimitive.update (http://202.197.18.14:8081/online3/pages/earth/js/Source/Scene/CompositePrimitive.js:384:31)

at updatePrimitives (http://202.197.18.14:8081/online3/pages/earth/js/Source/Scene/Scene.js:873:27)

at Scene.render (http://202.197.18.14:8081/online3/pages/earth/js/Source/Scene/Scene.js:929:9)

So could you help me with this problems?

Thanks!

-ZhangFan

Hi,

It looks like this exceeds your hardware limitation. Is this an older machine? What does webglreport.com report for “Max Texture Image Units” under “Fragment Shader?” Cesium tries to draw all the image layers at once, but this can exceed hardware-dependent limitations when several layers are used (two is quite low though). We plan to draw the layers in multiple passes to overcome this at some point.

Patrick

Thank you!

So the only thing I can do is to replace the machine with a higher configuration computer??

在 2014年5月6日星期二UTC+8上午8时45分21秒,Patrick Cozzi写道:

First time upgrading your video card drivers and browser.

Patrick

Sorry, I mean first try.

Hello,

								I've the last video card drivers and the last browser version and I've the same problem but when I try to make zoom over two or more layers in the same area. I add this layers from WMS server and if I make zoom the rendering is stopped. In my case Fragment Shader Max Texture Image Units are

Apart of draw the layers in multiple passes, are there any option to fix this error?

I’m very interested in drawing the layers in multiple passes, I will watch for your progress in this way.

Thanks!!

Aritz

Try this branch, which now has the multipass fallback: https://github.com/AnalyticalGraphicsInc/cesium/tree/quadtreePrimitive

Patrick

I try with this branch but the result is the same.

I have downloaded the zip file and uncompressed on my PC, after I have added Cesium b29 and my code. Do I make something else? modify something in the code?

Thanks!!

Aritz

This is not in b29. It is in a branch on github. If you do not want to use the version from github, keep an eye on the pull requests to see when this makes it into an official Cesium release, perhaps 1.0 (July) or 1.01 (August).

Patrick

I download the branch you said above, but it has errors when I run it.

The erros is as follows:

An error occurred while rendering. Rendering has stopped.
This may indicate an incompatibility with your hardware or web browser, or it may indicate a bug in the application. Visit http://get.webgl.org
to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:
RuntimeError: Fragment shader failed to compile. Compile log: ERROR: 0:237: ‘sampleAndBlend’ : no matching overloaded function found ERROR: 0:237: ‘assign’ : cannot convert from ‘const mediump float’ to ‘4-component vector of float’
Error
at new RuntimeError (http://localhost:8000/Cesium-quadtreePrimitive/Source/Core/RuntimeError.js:42:19 )
at createAndLinkProgram (http://localhost:8000/Cesium-quadtreePrimitive/Source/Renderer/ShaderProgram.js:675:23 )
at initialize (http://localhost:8000/Cesium-quadtreePrimitive/Source/Renderer/ShaderProgram.js:861:23 )
at ShaderProgram._bind (http://localhost:8000/Cesium-quadtreePrimitive/Source/Renderer/ShaderProgram.js:878:9 )
at beginDraw (http://localhost:8000/Cesium-quadtreePrimitive/Source/Renderer/Context.js:1784:12 )
at Context.draw (http://localhost:8000/Cesium-quadtreePrimitive/Source/Renderer/Context.js:1851:9 )
at DrawCommand.execute (http://localhost:8000/Cesium-quadtreePrimitive/Source/Renderer/DrawCommand.js:185:17 )
at executeCommand (http://localhost:8000/Cesium-quadtreePrimitive/Source/Scene/Scene.js:988:21 )
at executeCommands (http://localhost:8000/Cesium-quadtreePrimitive/Source/Scene/Scene.js:1217:17 )
at render (http://localhost:8000/Cesium-quadtreePrimitive/Source/Scene/Scene.js:1315:9 )
at Scene.render (http://localhost:8000/Cesium-quadtreePrimitive/Source/Scene/Scene.js:1350:13)

Can you help me with the problem.

在 2014年6月4日星期三UTC+8下午8时40分37秒,Patrick Cozzi写道: