2.1.x 3d模型显示错乱问题

Creator 版本:2.1.2

目标平台:H5

重现方式:MTK系列芯片设备

手机型号 :MTK系列芯片手机或平板

手机浏览器 :Chrome/75.0.3770.101

编辑器操作系统 :MacOS

出现概率:必现

期待表现:

实际表现:

设备参数:

测试过多个android设备,发现mtk系列的存在问题
利用Creator发布h5, 在mt基带系列使用firefox浏览器测试时,会发现GPU打印 "Is TextureConsistent: Texture and sampler are not consistent"错误提示信息。

使用Chrome浏览器测试时GPU并没有打印这个错误信息,不过两个浏览器的最终结果是一致的,查看Chrome的log发现打印如下:
“texture bound to texture unit is not renderable.It might be non-power-of-2 or have incompatible texture filtering”

于是查看Chrome源码,在https://chromium.googlesource.com/chromium/src/gpu/+/master/command_buffer/service/gles2_cmd_decoder.cc文件的 10739 行找到了这个错误信息:

if (!texture_ref ||
!texture_manager()->CanRenderWithSampler(
texture_ref, sampler_state)) {
*textures_set = true;
api()->glActiveTextureFn(GL_TEXTURE0 + texture_unit_index);
api()->glBindTextureFn(textarget, texture_manager()->black_texture_id(
uniform_info->type));
if (!texture_ref) {
LOCAL_RENDER_WARNING(
std::string("there is no texture bound to the unit ") +
base::NumberToString(texture_unit_index));
} else {
LOCAL_RENDER_WARNING(
std::string(“texture bound to texture unit “) +
base::NumberToString(texture_unit_index) +
" is not renderable. It might be non-power-of-2 or have”
" incompatible texture filtering (maybe)?”);
}
continue;

这里应该是CanRenderWithSampler返回0导致的错误

在文件<href=“https://chromium.googlesource.com/chromium/src/gpu/+/master/command_buffer/ser vice/texture_manager.h”/> 中找到了这个函数原型。

// True if this texture meets all the GLES2 criteria for rendering.
// See section 3.8.2 of the GLES2 spec.
bool CanRender(const FeatureInfo* feature_info) const;
bool CanRenderWithSampler(const FeatureInfo* feature_info,
const SamplerState& sampler_state) const;
在文件https://chromium.googlesource.com/chromium/src/gpu/+/master/command_buffer/service/texture_manager.cc中找到了这个函数的实现,通过代码注释看到Chrome是在判断texture的合法性,应该是说texture不符合GLES2 spec的要求,所以直接返回出错,感觉firefox导致的GPU打印出错信息,应该也是没有检测到texture的合法性而导致GPU出错

测试过不同android设备,目前发现mtk设备上会有这个问题,得出结论是:

使用mtk芯片,IMG型号的GPU设备都不可以正常显示3d模型

我们使用的3d模型是3d max 制作的fbx, 贴图为512*512的png图

麻烦引擎组成员能给看看,万分感谢!