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

Support point clouds #28

Closed
wants to merge 1 commit into from

Conversation

camnewnham
Copy link
Contributor

@camnewnham camnewnham commented Aug 4, 2021

This addresses #16 and brings atteneder/glTFast#135 to the 2020/MeshData api. Due to the new API the changes are also much simpler.

See atteneder/draco#2 for the draco component.
Note this PR doesn't include updated binaries (due to prior discussion of the security non-automated-created builds).

I haven't backdated the changes to the older API (!DRACO_MESH_DATA) and don't have a particular interest in doing so as it was significantly messier - I don't see this as an issue as it's a new feature for a new version.

Note vertex colors do not currently work for meshes or point clouds, I have added a separate issue to track this: #27

Happy to discuss!

@camnewnham
Copy link
Contributor Author

@atteneder just bumping this, have you had a chance to have a look?

@atteneder
Copy link
Owner

Sorry for not replying...I was on paternal leave when you opened the PR. I'll have a look!

@atteneder atteneder self-assigned this Sep 10, 2021
@atteneder
Copy link
Owner

@camnewnham Thanks for the repeated effort to get this done. I'll help you to land it this time.

Can you provide a draco compressed point cloud glTF (or a way to create them)? Never done that before.

Regards

@camnewnham
Copy link
Contributor Author

Hi @atteneder, congrats on the new arrival! Bet you're going to be busy :)

Here's a draco-compressed GLTF containing points.
bunny_pts_color_draco.zip

In three.js:
image

In glTFast/Unity (this PR):
image

Note that:

Here's the same model with only the draco component (.drc)
bunny_pts_color.zip

In threejs:
image

In glTFast/Unity (this PR):
image

I'm not sure whether the lack of colors in this case is due to the same vertex color issue mentioned above or is something separate when using the glTF vs drc.

@atteneder
Copy link
Owner

Just like with #27 , the uint8 colors are the problem here:

image

On top of that (hacking in a uint8 to float conversion) I had to choose a different shader that supports vertex colored points. Looks like the shader decision has to consider the topplogy or maybe it's possible to add point support to the existing ones.

@atteneder
Copy link
Owner

Thanks for your contribution ❤️
I rebased this PR, fixed conflicts and added support for 2019.4.
The color issue remains, but there's the dedicated issue for it.

@atteneder atteneder closed this Sep 11, 2021
@camnewnham
Copy link
Contributor Author

Thanks!

I had to choose a different shader that supports vertex colored points. Looks like the shader decision has to consider the topplogy or maybe it's possible to add point support to the existing ones.

I actually found atteneder/glTFast#228 because I was attempting to use the lack of PBR material as a hint to use a vertex-color unlit material. Instead, I ended up using a material name as the hint and when parsing the material in an IMaterialGenerator selected a vertex color compatible shader/material.

@atteneder
Copy link
Owner

Good solution! I imagined something similar.

atteneder added a commit to Unity-Technologies/DracoUnity that referenced this pull request Sep 9, 2024
* fix: auto-format

* fix: Removed obsolete pre-processor directives.

* fix: Minor cleanup of code smell

* fix: Avoid long namespace path in code
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