Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label : HeightReference.CLAMP_TO_GROUND "An error occurred while rendering." #6793

Closed
yijiao19 opened this issue Jul 11, 2018 · 15 comments · Fixed by #6828
Closed

label : HeightReference.CLAMP_TO_GROUND "An error occurred while rendering." #6793

yijiao19 opened this issue Jul 11, 2018 · 15 comments · Fixed by #6828

Comments

@yijiao19
Copy link

Today I update cesium 1.47 instaed 1.43.
But when I add a label with "heightReference: Cesium.HeightReference.CLAMP_TO_GROUND", the chrome reports me the text :

An error occurred while rendering. Rendering has stopped.
RuntimeError: Program failed to link. Link log: Could not pack varying v_logZ
Note: Additional non-conformant packing restrictions are enforced on D3D9.

Error
at new t (http://localhost:5000/libs/Cesium/1.47/Cesium.js:451:28517)
at f (http://localhost:5000/libs/Cesium/1.47/Cesium.js:480:17965)
at y (http://localhost:5000/libs/Cesium/1.47/Cesium.js:480:19679)
at d._bind (http://localhost:5000/libs/Cesium/1.47/Cesium.js:480:20694)
at G (http://localhost:5000/libs/Cesium/1.47/Cesium.js:508:913)
at k.draw (http://localhost:5000/libs/Cesium/1.47/Cesium.js:508:4878)
at n.execute (http://localhost:5000/libs/Cesium/1.47/Cesium.js:479:21080)
at Ge (http://localhost:5000/libs/Cesium/1.47/Cesium.js:530:16825)
at Xe (http://localhost:5000/libs/Cesium/1.47/Cesium.js:530:21309)
at tt (http://localhost:5000/libs/Cesium/1.47/Cesium.js:530:26613)

my test code:

var viewer = new Cesium.Viewer('cesiumContainer', {
    terrainProvider: Cesium.createWorldTerrain()
});
viewer.scene.globe.depthTestAgainstTerrain = true;

var e = viewer.entities.add({
    position : Cesium.Cartesian3.fromDegrees(-122.1958, 46.1915),
     label : {
        text : 'Clamped to ground',
        heightReference : Cesium.HeightReference.CLAMP_TO_GROUND,
        horizontalOrigin : Cesium.HorizontalOrigin.CENTER,
        verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
        fillColor : Cesium.Color.BLACK,
        showBackground : true,
        backgroundColor : new Cesium.Color(1, 1, 1, 0.7),
        backgroundPadding : new Cesium.Cartesian2(8, 4)
    }
});

viewer.trackedEntity = e;
@likangning93
Copy link
Contributor

Hi @yijiao19,

Cesium 1.45 added a logarithmic depth buffer, disabling it might help for now. Here's your code with log depth disabled on Sandcastle.

More technically, it's possible that you're running up against WebGL limits for your browser and graphics hardware when logarithmic depth is enabled. Can you attach a PDF of the results from webglreport.com?

@hpinkos
Copy link
Contributor

hpinkos commented Jul 11, 2018

Hi @yijiao19, I was unable to reproduce this. Do you see this crash in Cesium 1.46 too? Also, check to make sure Chrome is up to date, and try updating drivers for graphics card.

And as @likangning93 said, please send us the results from webglreport.com

@yijiao19
Copy link
Author

@likangning93 Thanks! I set logarithmicDepthBuffer=true, then fix the bug.

Chrome is the latest version. I guess my graphics hardware may be not available for webGL 2.0.

webgl report2
webgl report1

@likangning93
Copy link
Contributor

Hi @yijiao19, can you post a higher-resolution screenshot or preferably a PDF for the webgl 1 page on webglreport? Chrome and Firefox both allow using ctrl + p to print a webpage, and there should be an option to create a PDF instead of a printout.

@shunter
Copy link
Contributor

shunter commented Jul 12, 2018

WebGLReport is designed specifically so that you can easily copy/paste the page as text into notepad. ctrl-a, ctrl-c, ctrl-v into notepad. then copy/paste here.

@yijiao19
Copy link
Author

Hello @likangning93

Sorry, I try my best but the pdf of Chrome is confusing. So I also send you a higher-resolution screenshot of the page in chrome.

webgl report-chrome
WebGL Report-chrome.pdf
WebGL Report-firefox.pdf

@likangning93
Copy link
Contributor

Hi @yijiao19,

Thanks for the info! It looks like your graphics card should be able to run Cesium's newer features pretty well, but it's using old drivers since there's only support for D3D9.
Is it possible for you to update your graphics driver?

See here: http://www.nvidia.com/Download/index.aspx?lang=en-us

For your GPU, Product Type should be Quadro. Then, you'llhave to go to Product Series, select Show all Product Series, and then select Quadro NVS Series (Notebooks). It looks like you're using the NVS 5400M under Product.

The automatic detection thing might work too, but I haven't tried it.

@hpinkos
Copy link
Contributor

hpinkos commented Jul 13, 2018

I'm going to close this issue since it seems like an problem with the graphics driver, not a bug in Cesium. @yijiao19 if you update your drivers and you still see this crash, feel free to reopen this issue. Also try clearing your cache/cookies in case there's something cached from the older version of Cesium that's causing issues.

@hpinkos hpinkos closed this as completed Jul 13, 2018
@hpinkos
Copy link
Contributor

hpinkos commented Jul 18, 2018

This issue was reported by another user on the forum: https://groups.google.com/forum/#!topic/cesium-dev/XlaPQFwjozA

@hpinkos hpinkos reopened this Jul 18, 2018
@hpinkos
Copy link
Contributor

hpinkos commented Jul 18, 2018

I'm thinking the issue is that the WebGL report @yijiao19 posted says Max Varying Vectors: 9. With the depth testing changes BillboardCollection could have 8 varyings. This should be fixed by #6781 in many cases, but I'll have to see about packing things better for the case where vertex shader texture reads aren't available and the max varyings is low.

@lftgly
Copy link

lftgly commented Jul 19, 2018

Windows7 laptop with this render error for billboards clamped to ground:

Platform: Win32
Browser User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Context Name: webgl
GL Version: WebGL 1.0 (OpenGL ES 2.0 Chromium)
Shading Language Version: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit
Renderer: WebKit WebGL
Unmasked Vendor: Google Inc.
Unmasked Renderer: ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)
Antialiasing: Available
ANGLE: Yes, D3D9
Major Performance Caveat: No
Vertex Shader
Max Vertex Attributes: 16
Max Vertex Uniform Vectors: 253
Max Vertex Texture Image Units: 4
Max Varying Vectors: 9
Best float precision: [-2127, 2127] (23)
Transform Feedback
Coming in WebGL 2
Rasterizer
Aliased Line Width Range: [1, 1]
Aliased Point Size Range: [1, 256]
Fragment Shader
Max Fragment Uniform Vectors: 221
Max Texture Image Units: 16
float/int precision: highp/highp
Best float precision: [-2127, 2127] (23)
Framebuffer
Max Color Buffers: 1
RGBA Bits: [8, 8, 8, 8]
Depth / Stencil Bits: [24, 8]
Max Render Buffer Size: 8192
Max Viewport Dimensions: [8192, 8192]
Textures
Max Texture Size: 8192
Max Cube Map Texture Size: 8192
Max Combined Texture Image Units: 20
Max Anisotropy: 16
Uniform Buffers
Coming in WebGL 2
Supported Extensions:
ANGLE_instanced_arrays
EXT_blend_minmax
EXT_color_buffer_half_float
EXT_frag_depth
EXT_shader_texture_lod
EXT_texture_filter_anisotropic
WEBKIT_EXT_texture_filter_anisotropic
OES_element_index_uint
OES_standard_derivatives
OES_texture_float
OES_texture_float_linear
OES_texture_half_float
OES_texture_half_float_linear
OES_vertex_array_object
WEBGL_color_buffer_float
WEBGL_compressed_texture_s3tc
WEBKIT_WEBGL_compressed_texture_s3tc
WEBGL_debug_renderer_info
WEBGL_debug_shaders
WEBGL_depth_texture
WEBKIT_WEBGL_depth_texture
WEBGL_lose_context
WEBKIT_WEBGL_lose_context

The error:
An error occurred while rendering. Rendering has stopped.
RuntimeError: Program failed to link. Link log: Could not pack varying v_logZ
Note: Additional non-conformant packing restrictions are enforced on D3D9.

Error
at new t (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:451:28517)
at f (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:480:17965)
at y (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:480:19679)
at d._bind (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:480:20694)
at G (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:508:913)
at k.draw (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:508:4878)
at n.execute (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:479:21080)
at Ge (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:530:16825)
at Xe (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:530:21309)
at tt (https://lftgly.com/library/Cesium147/Cesium/Cesium.js:530:26613)

The test page that fails: https://lftgly.com/mount-washington-regional-mesonet3DCesium147.html
Same test page that runs ok: https://lftgly.com/mount-washington-regional-mesonet3DCesium146.html
was also running ok on Cesium 1.45.

@lftgly
Copy link

lftgly commented Jul 19, 2018

iPhone 6s has the same render error, slightly different syntax, here is its webglreport:

Platform: iPhone
Browser User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_2 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Version/11.0 Mobile/15C202 Safari/604.1
Context Name: webgl
GL Version: WebGL 1.0 (OpenGL ES 2.0 Metal - 52.1.2)
Shading Language Version: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.00)
Vendor: WebKit
Renderer: WebKit WebGL
Unmasked Vendor: Apple Inc.
Unmasked Renderer: Apple A9 GPU
Antialiasing: Available
ANGLE: No
Major Performance Caveat: No
Supported Extensions:
EXT_blend_minmax
EXT_sRGB
OES_texture_float
OES_texture_float_linear
OES_texture_half_float
OES_texture_half_float_linear
OES_standard_derivatives
EXT_shader_texture_lod
EXT_texture_filter_anisotropic
OES_vertex_array_object
OES_element_index_uint
WEBGL_lose_context
WEBKIT_WEBGL_compressed_texture_pvrtc
WEBGL_depth_texture
ANGLE_instanced_arrays
WEBGL_debug_renderer_info

My page referencing Cesium 1.46 loads fine on the iPhone.
My page referencing Cesium 1.47 throws the following ERROR on the iPhone:

"An error occurred while rendering. Rendering as stopped"
RuntimeError: Program failed to link. Link log: t@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:451:28526 f@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:480:17970 y@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:480:19680 _bind@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:480:20695 G@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:508:918 draw@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:508:4879 execute@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:479:21084 Ge@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:530:16832 Xe@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:530:21311 tt@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:530:26615 $e@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:530:24571 ht@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:531:1320 pt@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:531:1508 render@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:531:9357 render@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:537:18275 t@https://lftgly.com/library/Cesium147/Cesium/Cesium.js:537:11725

@likangning93
Copy link
Contributor

Hi @lftgly, are there updated graphics drivers available for your Windows 7 setup? We might be running up against your machine's varying limit as @hpinkos mentioned above, but a driver update (if available) could be a workaround. Related, do you know what the GPU model number (like HD 4000) or CPU model number (i5-3320m) is? The oldest Intel graphics I have on-hand is the HD 4000 from 6 years ago, which seems to be able to handle this feature when running with up-to-date drivers.

For iOS though, I'm seeing only 8 available varying vectors on a first-gen iPad Pro... this should be kind of representative, Apple seems to try to keep the capabilities available to WebGL consistent across iOS device generations.

@hpinkos
Copy link
Contributor

hpinkos commented Jul 19, 2018

@lftgly can you see if you still have this problem in our current master branch? Here's a zip file to download a build: http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/master/Cesium-1.47.0-master27825.zip

@cesium-concierge
Copy link

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/forum/#!topic/cesium-dev/XlaPQFwjozA

If this issue affects any of these threads, please post a comment like the following:

The issue at #6793 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants