mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 11:05:36 -05:00
27 lines
508 B
Text
27 lines
508 B
Text
|
#version 140
|
||
|
|
||
|
uniform vec2 p;
|
||
|
|
||
|
in vec4 position;
|
||
|
in vec4 icol;
|
||
|
|
||
|
out vec4 col;
|
||
|
flat out ivec4 colint;
|
||
|
|
||
|
void main (void)
|
||
|
{
|
||
|
gl_Position = vec4(p, 0.0, 0.0) + position;
|
||
|
|
||
|
// integers & vertex ID & instance ID
|
||
|
colint.x = gl_VertexID;
|
||
|
colint.y = gl_InstanceID ^ gl_InstanceID;
|
||
|
colint.z = gl_InstanceID << 2;
|
||
|
colint.w = colint.x + colint.y;
|
||
|
|
||
|
// new built-ins
|
||
|
col.x = trunc(position.x);
|
||
|
col.y = round(position.y);
|
||
|
col.z = roundEven(position.y);
|
||
|
col.w = cosh(position.w);
|
||
|
}
|