Skip to content

Basic support for glTF LINES primitive mode #1704

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GhisBntly
Copy link
Contributor

This is the result of hacking quick support for these lines in order to test a model I really wanted to see but that only had lines in it... ,^^
But I'm opening a draft PR in order to get feedback already, because I found it almost suspicious that lines weren't supported if it were that easy! Anything I'm missing?
I find this feature useful even without attenuation support, what do you think? I won't have much more time to work on this as it was never really part of my assignments...

TODO:

  • Only LINES for the moment, ie lists of segments: wouldn't be hard to support glTF line loops and strips I guess, but I'd need a dataset to test that.
  • "Basic support" = no support for rendering with "attenuation" like point clouds: haven't looked at the custom vertex factory and shader yet to see how hard it would be to support lines?
  • Probably need to change the name of CesiumGltfPointsComponent and proxy, unless it makes more sense to duplicate them.
  • Update CHANGES.md

Sample result: no screen capture because this is user data, sorry! Will try to find lines in one of our own models.

ie list of segments: wouldn't be hard to support line loops and strips I
guess, but I'd need a dataset to test that.

No support for rendering with "attenuation" like point clouds: haven't
looked at the custom vertex factory and shader yet to see how hard it
would be to support lines.

Probably need to change the name of CesiumGltfPointsComponent and proxy,
unless it makes more sense to duplicate them.
@GhisBntly GhisBntly force-pushed the basic-lines-support branch from b38fb4c to 6443579 Compare July 3, 2025 15:56
@j9liu j9liu self-requested a review July 3, 2025 16:10
Copy link
Contributor

@j9liu j9liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @GhisBntly for the PR! I don't think it would be much of a lift to add support for LINES, so feel free to keep working on this!

I would first suggest creating a separate CesiumGltfLinesComponent to detangle this implementation from the point one. You might find this #1037 a useful reference; it was the first PR where we added point support without worrying about attenuation.

Some of the SceneProxy / VertexFactory stuff is to support point attenuation. Basically we turn the points into billboarded quads to render them at a larger size, giving the point cloud a more opaque appearance. I'm not sure what line attenuation would look like, but it might help if you have any examples ^^

@GhisBntly
Copy link
Contributor Author

Thanks for the prompt feedback, @j9liu.
I was hoping a similar "line attenuation" would be able to render lines with a width greater than 1 pixel, but clearly billboards won't do ;^^ So I'll just do what you say and it'll be good enough for now 👍

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

Successfully merging this pull request may close these issues.

2 participants