#version 130 #ifdef GL_ES precision highp float; precision highp int; #endif #if __VERSION__ <= 120 int abs(int x){return int(abs(float(x)));} ivec2 abs(ivec2 x){return ivec2(abs(vec2(x)));} ivec3 abs(ivec3 x){return ivec3(abs(vec3(x)));} ivec4 abs(ivec4 x){return ivec4(abs(vec4(x)));} int sign(int x){return int(sign(float(x)));} ivec2 sign(ivec2 x){return ivec2(sign(vec2(x)));} ivec3 sign(ivec3 x){return ivec3(sign(vec3(x)));} ivec4 sign(ivec4 x){return ivec4(sign(vec4(x)));} int min(int x, int y){return int(min(float(x),float(y)));} ivec2 min(ivec2 x, ivec2 y){return ivec2(min(vec2(x),vec2(y)));} ivec3 min(ivec3 x, ivec3 y){return ivec3(min(vec3(x),vec3(y)));} ivec4 min(ivec4 x, ivec4 y){return ivec4(min(vec4(x),vec4(y)));} ivec2 min(ivec2 x, int y){return ivec2(min(vec2(x),float(y)));} ivec3 min(ivec3 x, int y){return ivec3(min(vec3(x),float(y)));} ivec4 min(ivec4 x, int y){return ivec4(min(vec4(x),float(y)));} int max(int x, int y){return int(max(float(x),float(y)));} ivec2 max(ivec2 x, ivec2 y){return ivec2(max(vec2(x),vec2(y)));} ivec3 max(ivec3 x, ivec3 y){return ivec3(max(vec3(x),vec3(y)));} ivec4 max(ivec4 x, ivec4 y){return ivec4(max(vec4(x),vec4(y)));} ivec2 max(ivec2 x, int y){return ivec2(max(vec2(x),float(y)));} ivec3 max(ivec3 x, int y){return ivec3(max(vec3(x),float(y)));} ivec4 max(ivec4 x, int y){return ivec4(max(vec4(x),float(y)));} int clamp(int x, int min_val, int max_val){return int(clamp(float(x),float(min_val),float(max_val)));} ivec2 clamp(ivec2 x, ivec2 min_val, ivec2 max_val){return ivec2(clamp(vec2(x),vec2(min_val),vec2(max_val)));} ivec3 clamp(ivec3 x, ivec3 min_val, ivec3 max_val){return ivec3(clamp(vec3(x),vec3(min_val),vec3(max_val)));} ivec4 clamp(ivec4 x, ivec4 min_val, ivec4 max_val){return ivec4(clamp(vec4(x),vec4(min_val),vec4(max_val)));} ivec2 clamp(ivec2 x, int min_val, int max_val){return ivec2(clamp(vec2(x),float(min_val),float(max_val)));} ivec3 clamp(ivec3 x, int min_val, int max_val){return ivec3(clamp(vec3(x),float(min_val),float(max_val)));} ivec4 clamp(ivec4 x, int min_val, int max_val){return ivec4(clamp(vec4(x),float(min_val),float(max_val)));} float trunc(float x){return sign(x)*floor(abs(x));} vec2 trunc(vec2 x){return sign(x)*floor(abs(x));} vec3 trunc(vec3 x){return sign(x)*floor(abs(x));} vec4 trunc(vec4 x){return sign(x)*floor(abs(x));} float round(float x){return floor(x+.5);} vec2 round(vec2 x){return floor(x+.5);} vec3 round(vec3 x){return floor(x+.5);} vec4 round(vec4 x){return floor(x+.5);} float roundEven(float x){return fract(x)==.5?2.*floor(x*.5+.5):floor(x+.5);} vec2 roundEven(vec2 x){return fract(x)==vec2(.5)?2.*floor(x*.5+.5):floor(x+.5);} vec3 roundEven(vec3 x){return fract(x)==vec3(.5)?2.*floor(x*.5+.5):floor(x+.5);} vec4 roundEven(vec4 x){return fract(x)==vec4(.5)?2.*floor(x*.5+.5):floor(x+.5);} float modf(float x, out float i){i=trunc(x);return x-i;} vec2 modf(vec2 x, out vec2 i){i=trunc(x);return x-i;} vec3 modf(vec3 x, out vec3 i){i=trunc(x);return x-i;} vec4 modf(vec4 x, out vec4 i){i=trunc(x);return x-i;} #endif void main(void){}