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

[Bug] Missing color property #3129

Open
barvirm opened this issue Oct 14, 2024 · 2 comments
Open

[Bug] Missing color property #3129

barvirm opened this issue Oct 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@barvirm
Copy link

barvirm commented Oct 14, 2024

Loader

Las loader

Description

I'm trying to load the attached LAS file, but the RGB information seems to be missing—all the colors are showing as [0,0,0,255]. However, I know the color data is present because the colors display correctly when I open the file with LiDARView using the RGB settings.

Model: https://mega.nz/file/T4VGyCwC#B0D_F4Cp9LU7mJrQgpJgf3s7NxGB8x84MkGy78QkeKs

Expected Behavior

Model with colors

image

Steps to Reproduce

const bytes = readFile("path");
const data = parseSync(bytes, LASLoader);

const colors = data.attributes['COLOR_0'];
// All colors are [0, 0, 0, 255]

Environment

Logs

No response

@barvirm barvirm added the bug Something isn't working label Oct 14, 2024
@ibgreen
Copy link
Collaborator

ibgreen commented Oct 14, 2024

Thanks for reporting.

  • The LAS loader is a wrapper around a compiled WASM library so loaders.gl is just trying to interpret and package the output of that rather opaque code.
  • If you could do some debugging by putting breakpoints in the loader and see if there is information coming from the WASM code that is not being forwarded by the JavaScript wrapper, that would be very helpful.

Color is extracted here https://github.com/visgl/loaders.gl/blob/master/modules/las/src/lib/parse-las.ts#L44

@barvirm
Copy link
Author

barvirm commented Oct 17, 2024

On the line 144:

colors[pointIndex * 4] = color[0];

Colors on the right side are: [20224, 21504, 16384, ...] but on the loader output I have colors [0,0,0,255, ...].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants