|
@@ -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)); }
|