mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
22 lines
350 B
Text
22 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];
|
||
|
}
|
||
|
}
|