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

Clipping plane with Arcgis terrain cause WebGL Error #7990

Closed
dhdbtkd opened this issue Jul 10, 2019 · 5 comments
Closed

Clipping plane with Arcgis terrain cause WebGL Error #7990

dhdbtkd opened this issue Jul 10, 2019 · 5 comments

Comments

@dhdbtkd
Copy link

dhdbtkd commented Jul 10, 2019

Clipping plane with Arcgis terrain cause WebGL Error

what

Sandcastle example: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=rVbZbuM2FP0VIkURGXEoydTqOEFbTzANMEADJNM8xPNASYxNRCYFkvLELfLvvdpiyXGmLlAbhsW7nHt4F1K2jb5qhtKcFwUXS1TkVDCNjESa5Sw1fMPyLVrxjKGCKqORfEJmxdAylwlDulRPNGV4IRZiQxXacPadKXSJBPuO5kzzco3/rGXWaVov51IYygVTp2P090Ig+BimFIhuldxAGDXtO/+q0s83d/c8Z9l1zjbUcCnuh/ZWC9P/lCqfotOVMYWe2jbrPEmGqUqXXONUru3m0VZMG1szteHA0H6QKt+FIp/sNho83azpkt2BIZAfhnwdLcTr6KLKQvVthFU+CskF5OwSPfYcetubQ0rhiQpinZNJPIn9CLsecTzfI4SMked4MQkiHIaOH8EvBBkJfBIGPnbIxA0nQRSHo/Fx6GEcYS+MoghgJ2GD7ocuJhEhQRxGE79BD8IYe27keR4J/WPBIy/CThA7rkuI32AHnoNJ7E88EkdBA+0HASae6wQkdB3vSGziuA6ehFHsEHfidMT9AEch8A/8yGvAvbjKnu9NAjfyj8aOQ+x4kRcCt46457o4ilwohxu0GfdDD/uO67s+bG/UQn+7eCv3rtpfmFiaFdS8WeK8Xu8sbRvNFaMGho4J6P2uSZ6kQoymq71Z7OF3ittmRqGrKgK1unK2KhsOYucC/mYDOhfo7IyPUH9UKmvBXsyNyNgLeFkcnSF3hH4eOu55rHlWq8HhXUIxzTKrcX7k38YtzuNbEBAdLsRo1A/zwxDrMje8yLe/be9SmlNlddZj5GAoX7cc7RLeUS+Lg4hCqjXN+V+sB3UMzQpS8eXqME9dJkbR1FgHkvDf4nwcY8e8thk3pgd23hgexEiV1LrzL4vjKP0Ab8epeRq3xnusqiGQ66KEKci4NlSkDCVbVChmmMiq5q8umXoAENeImnotgSff31wjnNezxLJ6NoYXUC16o+Ng510Z3yhcDnzwkpnbqlCfWr11INaHLTecVlyUemX1k9tXv7HrmOzy/dodAPU1ijUcGkCsun3xu/PgI/i5zOu7XIrBZdne9dM9qv2Dk2VL9sAzs5oiZ18OqBJu6y5gtcIPv9/cXw8MBU3g8oYgRpXdYdbelSfjk5k225xdNfJf+LqQylS3t4WxbdgaGEJj2UmZPjODU627tPxkpMwTKF1vPwlNn5dKliKbIrVMqOVN4Dhvfw6O+mUv4KiCDU+RV7z0xIlU8EZxrmjGS91Xvu6F5QJ6tx8cXgoMhxPpHJp/KaZVU2Q5ex/x3MhiiiaDqJ0qkcbIdV8LYWd2l6JZxjeIZ5eLk71XqcUJVJBqDZqnMs/vYPoWJ1czG+wHbrmkVZw/gGtOt5XJyr360ggxxjMblu+92i2DecNp1rwYoowaep5wUdnIomouyBh7oVA0dr8toI9gtvKSQXuVSsHIXO90Nb0Gp0NtMmpAWW1wxdLnRL7AzmqMamc01+A3CFubsWy/ga+bnmvjfy3ABVic1hFOITT6XL+87r/ztq36f/CpxuMOygbo/0rmGmyRbox3HLo6/AM

Browser: IE, Chrome, Firefox

Operating System: Win 10 64bit

@OmarShehata
Copy link
Contributor

OmarShehata commented Jul 11, 2019

Thanks for reporting this @dhdbtkd . This does look like a bug. It's easy to see in the globe clipping plane example as well:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Terrain%20Clipping%20Planes.html

By replacing the terrain provider with:

terrainProvider: new Cesium.ArcGISTiledElevationTerrainProvider({
        url: 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer'
    })

It's complaining that the number of texture units exceeds what's supported (which is 16 based on WebGL report for me). If you log the number of used texture units in the globe shader here:

https://github.com/AnalyticalGraphicsInc/cesium/blob/3601fc73247ab3526c4f18be38ccc8c1860a541b/Source/Scene/GlobeSurfaceShaderSet.js#L185

You can see it's 2-3 for regular Cesium World Terrain, and 16 for the ArcGIS terrain. I think that in itself is right at the limit, but then when you add a clipping plane it needs an extra texture (since clipping planes are stored as textures) and that's when it crashes.

@mramato
Copy link
Contributor

mramato commented Jul 11, 2019

This may be video card or OS specific because this works fine for me (Linux, Intel). @OmarShehata I assume from your comment that you can easily reproduce?

@OmarShehata
Copy link
Contributor

OmarShehata commented Jul 11, 2019

@mramato I can reproduce. What's your Max Texture Image Units on WebGL report? Mine is 16.

@likangning93
Copy link
Contributor

likangning93 commented Jul 11, 2019 via email

@mramato
Copy link
Contributor

mramato commented Jul 11, 2019

Mine is 32, so that makes sense. I thought we had a test that made sure we supported the minimum but I'm guessing @likangning93 is on the right path and that two systems aren't aware of what each other are using.

ppoulainpro added a commit to ppoulainpro/cesium that referenced this issue Jul 15, 2019
Fix issue CesiumGS#7990 and also similar case when globe shading is on.
lilleyse added a commit that referenced this issue Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants