visgl / loaders.gl

Loaders for big data visualization. Website:
https://loaders.gl
Other
712 stars 193 forks source link

[Bug] Missing color property #3129

Open barvirm opened 4 weeks ago

barvirm commented 4 weeks ago

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

ibgreen commented 4 weeks ago

Thanks for reporting.

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

barvirm commented 3 weeks ago

On the line 144: https://github.com/visgl/loaders.gl/blob/e4946a503c1ec0460363c834e4e9c386c91ee98b/modules/las/src/lib/parse-las.ts#L114

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