"unsupported type error" with RGBE loader for .HDR file types
Asked Answered
M

1

5

I use ThreeJS, and specifically the RGBE loader to load my HDR files. https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/RGBELoader.js

This worked fine until a recent upgrade, now when I attempt to use HDR files with the loader, I receive the following message: When I try to run the code I receive an error at runtime: THREE.RGBELoader: unsupported type: 1009

enter image description here

It appears that the RGBELoader is unable to parse the file -- from googling this specific error, it seems to typically be due to people importing their HDR wrong.

For further reference, here is my asset-loading code:

// (prev code in my asset loader to get the path to the asset, and url of my .hdr file)

if (type == 'hdr') {
    new RGBELoader()
        .setDataType(THREE.UnsignedByteType)
        .setPath( _BASE_ASSET_URL )
        .load( url, function ( loadedItem ) {

            scope.assets[name] = loadedItem

    })
}
Margarettmargaretta answered 9/6, 2022 at 14:12 Comment(0)
J
9

.setDataType(THREE.UnsignedByteType)

Since r136, the constant THREE.UnsignedByteType is not a valid data type for THREE.RGBELoader anymore. Please use THREE.HalfFloatType (the default) or THREE.FloatType.

Jasmine answered 9/6, 2022 at 15:4 Comment(2)
Ah thankyou! This was the solutionMargarettmargaretta
Would be great if you could accept this post as an answer then.Jasmine

© 2022 - 2024 — McMap. All rights reserved.