Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
None
-
6.3.0
-
None
Description
The attached code compiles just fine, but I get a runtime error.
It seems like the auto-generated fragment shader uses attributes which is not allowed and results in the error. Sadly I do not understand what exactly I'm doing wrong or how to resolve this error.
QOpenGLShader::compile(Fragment): 0(7) : error C7513: OpenGL does not allow attribute variables in fragment shaders
*** Problematic Fragment shader source code ***
#version 110
#ifdef GL_KHR_blend_equation_advanced
#extension GL_ARB_fragment_coord_conventions : enable
#extension GL_KHR_blend_equation_advanced : enable
#endif
#define lowp
#define mediump
#define highp
#line 1
#define LAYER_diffuse
#define LAYER_specular
#define LAYER_normal
uniform highp vec3 eyePosition;
attribute highp vec3 worldPosition;
attribute highp vec3 worldNormal;
uniform highp float shininess;
uniform highp vec4 ks;
uniform highp vec4 kd;
uniform highp vec4 ka;
... <source code of qt3d/src/extras/shaders/es2/phong.inc.frag> ...
void main()
{
gl_FragColor = (((((((phongFunction(ka, kd, ks, shininess, worldPosition, normalize(((eyePosition - worldPosition))), normalize(worldNormal)))))))));
}
After some searching around here, it seems like this could be a duplicate of QTBUG-99019
further clarification would be great though!