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

Fix vertex shader generation for draco-compressed RGB per-vertex color #7581

Merged
merged 1 commit into from
Feb 18, 2019

Conversation

likangning93
Copy link
Contributor

Fixes #7576.

Draco-compressed models with RGB per-vertex color were causing vertex-shader compilation failure because the existing per-vertex-color shader assumes RGBA (vec4) per-vertex color, but the decoding glsl injected decodes to RGB (vec3).

This PR detects when COLOR_0 is getting decoded to vec3 and wraps access in the vertex shader in a vec4.

There's also a pair of new spec models generated by running BoxVertexColors and a modified variant with vec3 vertex color through gltf-pipeline for Draco compression.

I tried using draco-compressed versions of the "Vertex Color Test" model, but the checkVertexColors test function wouldn't produce the same results, I suspect because of compression artifacts making a difference when rendering at 1x1.

@cesium-concierge
Copy link

Thanks for the pull request @likangning93!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@likangning93
Copy link
Contributor Author

@lilleyse re-ran CI and now it's passing

@lilleyse
Copy link
Contributor

Looks good, thanks!

@lilleyse lilleyse merged commit c648159 into master Feb 18, 2019
@lilleyse lilleyse deleted the dracoRgbVertexColor branch February 18, 2019 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants