diff options
| author | yum <yum.food.vr@gmail.com> | 2024-10-24 18:45:29 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-10-24 18:45:29 -0700 |
| commit | 1705cd25f5bcd796a560bcce22ef91d190a94900 (patch) | |
| tree | 122c80d25228e2e7c83fa720982576535223ebab /math.cginc | |
| parent | 09aa66c9c13965105133ca000da4d2c37d455877 (diff) | |
add water stuff
Diffstat (limited to 'math.cginc')
| -rw-r--r-- | math.cginc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -125,6 +125,11 @@ float dabs(float a, float k) return log2(exp2(k * a) + exp2(-1.0 * k * a)); } +float dsaturate(float x, float k) +{ + return dmin(dmax(x, 0, k), 1, k); +} + float rand(uint seed) { seed = seed * 747796405 + 2891336453; uint result = ((seed >> ((seed >> 28) + 4)) ^ seed) * 277803737; |
