cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

glTF文件中自定义属性的normalized=true实际不生效

Open veiveim opened this issue 1 year ago • 2 comments

Cocos Creator version

3.8.2

System information

macOS 13.6.5, GPU: Intel Iris Plus Graphics 650 1536 MB, Chrome 123.0.6312.59, GLES3

Issue description

对于glTF格式的模型文件,如果属性名为COLOR_0,则属性的normalized=true在cocos中会生效,如下图,图片左边是glTF文件中的属性参数,右边是spectorjs中实际属性的参数。 Screenshot 2024-03-27 at 15 38 24 如果属性名是以下划线开头的自定义属性(如:_COLOR),则属性的normalized=true在cocos中不生效,如下图。 Screenshot 2024-03-27 at 15 31 40

Relevant error log output

No response

Steps to reproduce

在blender中创建以下划线开头的且数据类型为Byte Color的自定义属性,以glTF格式导出模型文件(导出时勾选自定义属性),该属性在glTF中的类型会是unsigned short且normalized=true,将模型导入cocos并渲染,在spectorjs中查看会发现该属性并未normalize。

Minimal reproduction project

No response

veiveim avatar Mar 27 '24 08:03 veiveim

能否提供下你的 gltf 文件?

minggo avatar Jun 07 '24 10:06 minggo

能否提供下你的 gltf 文件?

@minggo gltf文件见附件,再次验证了一下,问题仍然存在。在effect中将 _COLOR 进行normalize后可以正常渲染(图1),否则渲染出来就是白色的立方体(图2)。 Screenshot 2024-06-18 at 16 00 06 Screenshot 2024-06-18 at 16 01 07

test_gltf.zip

veiveim avatar Jun 18 '24 08:06 veiveim