我使用三个J,特别是RGBE加载程序来加载HDR文件。
这效果很好,直到最近的升级为止,现在我尝试使用加载程序使用HDR文件时,我会收到以下消息:
当我尝试运行代码时,我会在运行时收到一个错误: trim.rgbeloader:未支撑类型:1009
看来RGBELOADER无法解析文件 -通过谷歌搜索这个特定的错误,似乎通常是由于人们导入HDR错误的原因。
为了进一步参考,这是我的资产加载代码:
// (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
})
}
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

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
})
}
发布评论
评论(1)
以来,由于
r136
,常数three.unsignedbydetype
不是three.rgbeloader
的有效数据类型。请使用three.halffloattype
(默认值)或three.floattype
。Since
r136
, the constantTHREE.UnsignedByteType
is not a valid data type forTHREE.RGBELoader
anymore. Please useTHREE.HalfFloatType
(the default) orTHREE.FloatType
.