attribute vec4 vPosition; void main() { gl_Position = vPosition; gl_PointSize = 5.0; }
Shader compilation failed: 0:14(2): error: initializer of type float cannot be assigned to variable of type int
Type Needed | Implicit conversion from |
---|---|
uint | int |
float | int,uint |
double | int, uint, float |
Base Type | 2D vec | 3D vec | 4D vec | Matrix Types | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
float | vec2 | vec3 | vec4 |
| ||||||||||||
double | dvec2 | dvec3 | dvec4 |
| ||||||||||||
int | ivec2 | ivec3 | ivec4 | - | ||||||||||||
uint | uvec2 | uvec3 | uvec4 | - | ||||||||||||
bool | bvec2 | bvec3 | bvec4 | - |
vec4 color = vec4(red,green, blue, 1.0);
ivec3 silly = ivec3(color);
vec4 color = vec4(1.0);
sets all four components to 1.0| 1.0 0.0 0.0 | f = | 0.0 1.0 0.0 | | 0.0 0.0 1.0 |
| 1.0 4.0 7.0 | f = | 2.0 5.0 8.0 | | 3.0 6.0 9.0 |
struct Cell_T { int age; vec3 location }; Cell_T a = CellT(0,10,20,30);