diff --git a/docs/Materials.md.html b/docs/Materials.md.html index 3a7cf52f72..d3c26a508a 100644 --- a/docs/Materials.md.html +++ b/docs/Materials.md.html @@ -1331,6 +1331,7 @@ type aliases: **getWorldCameraPosition()** | float3 | Position of the camera/eye in world space **getTime()** | float | Current time in seconds, may be reset regularly to avoid precision loss **getUserTime()** | float4 | Current time in seconds: `time`, `(double)time - time`, `0`, `0` +**getUserTimeMode(float m)** | float | Current time modulo m in seconds **getExposure()** | float | Photometric exposure of the camera **getEV100()** | float | [Exposure value at ISO 100](https://en.wikipedia.org/wiki/Exposure_value) of the camera diff --git a/shaders/src/common_getters.fs b/shaders/src/common_getters.fs index 428a36544e..964be0fc05 100644 --- a/shaders/src/common_getters.fs +++ b/shaders/src/common_getters.fs @@ -47,6 +47,10 @@ HIGHP vec4 getUserTime() { return frameUniforms.userTime; } +HIGHP float getUserTimeMod(float m) { + return mod(mod(frameUniforms.userTime.x, m) + mod(frameUniforms.userTime.y, m), m); +} + /** @public-api */ float getExposure() { return frameUniforms.exposure;