WebGL纹理红色并在Apple设备上闪烁

时间:2021-12-02 05:04:54

I'm currently in the progress of writing a simple WebGL application, where multiple textures are blended on top of each other.

我目前正在编写一个简单的WebGL应用程序,其中多个纹理相互混合。

The application works fine in Chrome, Firefox and IE on Windows, and also works on Android phones.

该应用程序在Windows上的Chrome,Firefox和IE中运行良好,也适用于Android手机。

On Apple devices, however, the textures are red and flickering in any browser. I tested this on Safari on iPhone or Chrome and Firefox on a MacBook.

但是,在Apple设备上,纹理在任何浏览器中都是红色和闪烁的。我在iPhone上的Safari或MacBook上的Chrome和Firefox上测试了这个。

For example, the desired result is a wooden texture:

例如,所需的结果是木质纹理:

WebGL纹理红色并在Apple设备上闪烁

However, on Apple devices, this is shown:

但是,在Apple设备上,显示如下:

WebGL纹理红色并在Apple设备上闪烁

There are no errors and no warnings from WebGL. What could be the issue or a hint to the issue here?

WebGL没有错误也没有警告。这个问题可能是什么问题或暗示?

1 个解决方案

#1


0  

In this case, the solution was to initialize all variables used inside the fragment shader, which was not done correctly.

在这种情况下,解决方案是初始化片段着色器内使用的所有变量,这些变量未正确完成。

#1


0  

In this case, the solution was to initialize all variables used inside the fragment shader, which was not done correctly.

在这种情况下,解决方案是初始化片段着色器内使用的所有变量,这些变量未正确完成。