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

Picking with Globe Materials / Globe Lighting enabled makes the shader compilation fail #6039

Closed
shehzan10 opened this issue Dec 8, 2017 · 5 comments

Comments

@shehzan10
Copy link
Member

This can be reproduced by using the globe materials sandcastle and just clicking anywhere on the terrain.

The shader compilation failure log is:

[Cesium WebGL] Vertex shader compile log: ERROR: 0:177: 'normalMC' : undeclared identifier
ERROR: 0:177: '=' : dimension mismatch
ERROR: 0:177: '=' : cannot convert from 'const highp float' to 'highp 3-component vector of float'

[Cesium WebGL] Vertex shader translation failed.
Uncaught RuntimeError: Vertex shader failed to compile.  Compile log: ERROR: 0:177: 'normalMC' : undeclared identifier
ERROR: 0:177: '=' : dimension mismatch
ERROR: 0:177: '=' : cannot convert from 'const highp float' to 'highp 3-component vector of float'

Error
    at new RuntimeError (http://localhost:8004/Source/Core/RuntimeError.js:42:19)
    at createAndLinkProgram (http://localhost:8004/Source/Renderer/ShaderProgram.js:246:23)
    at initialize (http://localhost:8004/Source/Renderer/ShaderProgram.js:451:23)
    at ShaderProgram._bind (http://localhost:8004/Source/Renderer/ShaderProgram.js:468:9)
    at beginDraw (http://localhost:8004/Source/Renderer/Context.js:937:12)
    at Context.draw (http://localhost:8004/Source/Renderer/Context.js:1000:9)
    at DrawCommand.execute (http://localhost:8004/Source/Renderer/DrawCommand.js:502:17)
    at executeCommand (http://localhost:8004/Source/Scene/Scene.js:1722:21)
    at executeCommands (http://localhost:8004/Source/Scene/Scene.js:1977:17)
    at executeCommandsInViewport (http://localhost:8004/Source/Scene/Scene.js:2472:9) (on line 246 of http://localhost:8004/Source/Renderer/ShaderProgram.js)

Using Cesium version 1.40.

@hpinkos
Copy link
Contributor

hpinkos commented Dec 8, 2017

Good catch @shehzan10, thanks! I marked this issue as priority - next release

@jasonbeverage @bagnell any idea what might be happening here?

@lilleyse
Copy link
Contributor

lilleyse commented Dec 8, 2017

I think it is related to this comment: #5919 (comment)

My guess is the globe material code, which requires normals, is being added to the pick shader, which doesn't include normals. The fix would be to not apply materials to the pick shader.

This is essentially the same issue as the linked comment. When enableLighting is false the regular shader doesn't include normals, but the globe material expects them to exist.

I should be able to get to this before the next release.

@hpinkos
Copy link
Contributor

hpinkos commented Dec 8, 2017

Great, thanks @lilleyse!

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 8, 2017

@lilleyse - as long as the material doesn't discard...

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 17, 2017

Thanks again for the report, @shehzan10. This is fixed in #6063.

@pjcozzi pjcozzi closed this as completed Dec 17, 2017
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