-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Improve outlining for solid geometry in glTFs #8776
Conversation
The last commit before Prettier was used to reformat the code.
Relative to pre-prettier, this commit _only_ reformats the code with Prettier. There are no other changes.
Thanks for the pull request @kring!
Reviewers, don't forget to make sure that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kring some preliminary feedback for the Renderer
and Scene
changes, mostly either small or philosophical things. From what I can tell this looks pretty solid 👌
I'll take a look at the Specs
changes soon.
Thanks for the review @likangning93! I think I've addressed everything, except that I need to write a test or two for the index enbiggening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kring! Just one more place where doc needs updating. I took a look at the specs too, those pretty much look good to me.
Oof. That sounds like it's going to be an impressive spec. |
Ready for another look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kring! The new spec looks great 👍, just one more thing:
Thanks @kring! I can merge this once CI passes. |
@likangning93 Can you provide an example program to realize the effect of contour line in cesium? thank you! |
Fixes #8689
Adds explicit solid geometry outlining for glTF, roughly following the technique described in this paper: https://www.researchgate.net/publication/220067637_Fast_and_versatile_texture-based_wireframe_rendering
With this technique, we get high quality, anti-aliased, non-depth-fighting edges without any additional draw calls.
The edges to outline are specified using a glTF extension, a rough draft of which is here:
https://github.com/kring/glTF/blob/CESIUM_primitive_outline/extensions/2.0/Vendor/CESIUM_primitive_outline/README.md
In short, the edges are specified using an indexed line list, much like you'd do with a separate GL_LINES primitive. There's a bit of extra work at load time to turn this edge list into additional vertex attributes, and sometimes it even requires duplicating vertices. I initially thought I'd have to do this in a web worker, but the performance seems quite good, so I'm going to try to get away without. Doing it in a web worker would requiring shuffling vertex and index buffers around, which would be a hassle and possibly cost more time than it saves.
Bonus features in this PR:
GltfBuilder
class in the tests, which is a handy way of building glTF models on the fly. It's a bit half-baked right now, but it made theModelOutlineLoader
tests easier to write and (hopefully) understand.