“不支持类型错误”使用.HDR文件类型的RGBE加载器

发布于 2025-02-06 10:37:44 字数 913 浏览 2 评论 0 原文

我使用三个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

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

    })
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏雨凉 2025-02-13 10:37:44

.setDatatype(三

以来,由于 r136 ,常数 three.unsignedbydetype 不是 three.rgbeloader 的有效数据类型。请使用 three.halffloattype (默认值)或 three.floattype

.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文