mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 00:31:28 -05:00
21 lines
350 B
Text
21 lines
350 B
Text
#define MAX_ITER 5
|
|
|
|
attribute vec4 a_position;
|
|
|
|
uniform int u_iter;
|
|
uniform vec4 u_deltas[MAX_ITER];
|
|
|
|
int my_min(int a, int b) {
|
|
if (a < b) {
|
|
return a;
|
|
} else {
|
|
return b;
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
gl_Position = a_position;
|
|
for (int i = 0; i < my_min(u_iter, MAX_ITER); i++) {
|
|
gl_Position += u_deltas[i];
|
|
}
|
|
}
|