'WebGL last attributes do not work in Chrome on Windows
I have this code in my vertex shader:
in vec3 geometry;
in vec4 offset; // xyz - offset, w sizeFactor
in vec4 rotationQuad;
in vec2 textureCoord;
in vec2 textureNr;
in highp float faceNumber;
in vec4 lightMatrix1;
in vec4 lightMatrix2;
in vec4 lightMatrix3;
in vec4 lightMatrix4;
in vec4 lightMatrix5;
in vec4 lightMatrix6;
The last two attributes "lightMatrix5" and "lightMatrix6" are not working in Chrome on Windows. In Firefox all works fine also on Chrome with Ubuntu Linux.
When I change the order of the attributes, the last two defined stop working. E.g:
in vec4 lightMatrix1;
in vec4 lightMatrix2;
in vec4 lightMatrix5;
in vec4 lightMatrix6;
in vec4 lightMatrix3;
in vec4 lightMatrix4;
Now the "lightMatrix3" and "lightMatrix4" do not work but the "lightMatrix5" and "lightMatrix6" work fine now.
The Parameters from WebGL look like this:
WebGLInfo::: WebGL 2 supported
WebGLInfo::: Max Vertex Attributes 16
WebGLInfo::: Max Varying Vectors 32
WebGLInfo::: Max Vertex Uniform Vectors 1024
WebGLInfo::: Max Fragment Uniform Vectors 1024
Possible attributes should be 16, I'm using 12 and the limit seams to be 10?
Any idea why it happens and how to solve it?
Thanks a lot!
Solution 1:[1]
I replaced the 4 vec4 (lightmatrix1-4) attributes with one mat4 attribute and it is working now. The attributes count seams to matter.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Remigius Kijok |
