-
Notifications
You must be signed in to change notification settings - Fork 250
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
Points Support #135
Comments
Hi @camnewnham , Thanks for the great suggestion and putting in the effort. You're right about the Draco limitation. Currently I refactor the Draco integration (re-base on recent version plus use the advanced Mesh API). It would make sense to wait for this new version or start working on the according branch( draco and DracoUnity). I'm not experienced in point cloud rendering in Unity. I'm pretty sure we can make sure that the vertex colors are imported correctly. It is likely the material/shader that's not using the vertex colors correctly. This assumption would have to be put to test. Otherwise I see no obvious blockers for this feature. Regards, |
It looks like the color ordering is a result of the indexing in the jobs. i.e. Rather than
we need:
This likely also resolves #138 I'll make a PR accordingly before moving onto the draco component. |
Awesome finding! |
Here's a first go at allow draco to work with the point clouds. Draco changes: atteneder/draco@unity...camnewnham:unity_point_clouds
(note I am a C++ amateur so any advice is most welcome - there's a bunch of code duplication here for mesh vs pt processing) DracoUnity changes: atteneder/DracoUnity@main...camnewnham:unity_point_clouds
Originally I had thought to pass a value based on the topology declared in the glTF - but this logic doesn't work when using the draco file importer (and could lead to conflicts for poorly formatted files). glTFast changes: main...camnewnham:unity_point_clouds
Last remaining is to include and map an appropriate vertex color material/shader when topology is points - I think it's a reasonable assumption that point clouds should prioritize vertex colors over GLTF assigned material and select a vertex color shader instead (i.e. they might have a PBR assigned due to their creation process). |
Thanks, much appreciated! |
Addition of default points shader |
Sorry for the delay. I had a look across it (didn't test so far). glTFast and DracoUnity look good overall. Some thoughts about the native part:
Thank you very much! |
Thanks for having a look. I'll move the changes up to the latest once there's a stable glTFast/DracoUnity/draco combination (or is this the case now?) so that I can tell if breaking things are my issue or pre-existing. I ran the CI here: https://github.com/camnewnham/draco/actions/runs/587740664 so comparing to the prior builds: https://github.com/atteneder/draco/actions/runs/525167332 we get: So that seems like a pretty negligible change in size for the feature? Agree on the redundant code - my C++ is a bit lacking. I've updated again (atteneder/draco@unity...camnewnham:unity_point_clouds) using templates which seems to work well and removes the majority of the duplication. |
Now that points support is tested (both regular and Draco compressed) I am closing this issue. For improved/dedicated point cloud materials I created issue #246 Thanks! |
I'm interested in doing some work to extend support of POINTS geometry and would like to scope it and determine whether it's a welcome extension to this library beforehand.
The current behaviour is:
Gltf
With Draco
Technically it's not in the spec (see spec and discussion KhronosGroup/glTF#1809), but the default three.js GltfLoader/DracoLoader will load a point cloud compressed with Draco without issue and the file size reduction is of course significant.
From what I can tell, the main changes would appear to be:
draco_unity_plugin.cc
to allow points. Currently:a. Creation/addition of a point rendering shader including vertex colors, used when topology == points
b. VertexColorUnlit is showing jumbled colors on the points, so this may need more investigation.
For clarity of 2b, here's in Unity with glTFast and the VertexColors material:
And here's the same with three.js:
@atteneder at a cursory glance are there any other parts that would need modification, or do you have any other tips?
The text was updated successfully, but these errors were encountered: