-
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
3D Tiles - Point Cloud color compression #4315
Conversation
+1 for staying with the simple approach, especially given they are the same size and that RGB565 is a common WebGL format (texture, not attribute AFAIK; regardless, it is still familiar). Did you just eyeball the difference or did you diff them or find any reading on perception to compare the two? |
@hobu @connormanning RGB565 is an optional lossy compressed per-point color format that you may want to check out to store colors in 16 bits. |
@@ -520,6 +532,16 @@ define([ | |||
if (hasColors) { | |||
if (isTranslucent) { | |||
vs += 'attribute vec4 a_color; \n'; | |||
} else if (isYCoCg || isRGB565) { | |||
vs += 'attribute float a_color; \n' + | |||
'const float SHIFT_RIGHT_11 = 1.0 / 2048.0; \n' + |
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.
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.
I feel like passing on this for now.
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.
OK, added to the roadmap. Good beginner low-hanging fruit.
Just those comments. Let me know when this is ready with tests for review. Can you please also open a PR for the spec? |
Yeah, just ran my demo and compared the results visually. They both have banding, just in different ways. |
e5f61d8
to
2cc0901
Compare
2cc0901
to
d40a3b9
Compare
Removed ycocg and added a test. This is ready now. I'll update the spec. |
I was hoping for something more scientific, but given that RGB565 is widely used in GL, I think it is appropriate. Other options can be added later, of course. |
Spec update: CesiumGS/3d-tiles#130 |
For #3241 and CesiumGS/3d-tiles#22 (comment)
I tried out two different ways of compressing point cloud colors
Results:
http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/color-compression/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=29c700b58600b669fbbf9e30aeeac914
Overall I don't think YCoCg offers much benefit and may not be suited for this purpose. The RGB565 and YCoCg results are pretty similar, and conceptually RGB565 is simpler.
Note: once people have a chance to check out the demo and review the code I'm going to remove the Temp folder and add the point clouds to the main folder, as well as write a simple test. I'll squash the changes so we don't have the large point clouds still in the repo afterwards.