简体   繁体   English

为什么着色器会使用属性int编译错误(Android opengl es2)

[英]why shader compile error with attribute int (Android opengl es2)

why shader compile error with attribute int? 为什么着色器使用属性int编译错误? (Android opengl es2) (Android opengl es2)

attribute vec4 a_Position;
attribute vec2 a_TexCoord;
attribute int a_fckLen; ///--error compile 
attribute float a_fckLen; //--compile ok

void main()
{

        gl_Position = u_Matrix * a_Position;
}

but float compile OK 但是浮动编译就可以了

From GLSL ES 1.00 (the one GL ES 2 uses) specification: 从GLSL ES 1.00(一个GL ES 2使用)规范:

4.3.3 Attribute 4.3.3属性

... ...

The attribute qualifier can be used only with the data types float , vec2 , vec3 , vec4 , mat2 , mat3 , and mat4 . attribute限定符只能与数据类型floatvec2vec3vec4mat2mat3mat4 Attribute variables cannot be declared as arrays or structures. 属性变量不能声明为数组或结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM