Skip to content
Snippets Groups Projects
Commit f266dfad authored by Alexander Rose's avatar Alexander Rose
Browse files

emulate round function for webgl1 compatibility

parent 99048eed
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,10 @@ export const common = `
#define saturate(a) clamp(a, 0.0, 1.0)
#if __VERSION__ == 100
#define round(x) floor((x) + 0.5)
#endif
float intDiv(const in float a, const in float b) { return float(int(a) / int(b)); }
vec2 ivec2Div(const in vec2 a, const in vec2 b) { return vec2(ivec2(a) / ivec2(b)); }
float intMod(const in float a, const in float b) { return a - b * float(int(a) / int(b)); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment