From 9627b2286a767d41e2887cca0fd6bc88af3db201 Mon Sep 17 00:00:00 2001 From: Vincent Tavernier <vincent.tavernier@inria.fr> Date: Wed, 19 Jul 2017 13:02:41 +0200 Subject: [PATCH] Replace iGlobalTime with iTime --- README.md | 2 +- examples/10-gradient/main.cpp | 2 +- examples/10-gradient/shader.glsl | 2 +- include/shadertoy/UniformState.hpp | 2 +- include/shadertoy/UniformState_impl.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 546664f..006de93 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ See the `examples/` folder on how to use this library. Note that only `iResolution`, `iTimeDelta`, `iFrameRate`, `iChannel0`, `iChannel1`, `iChannel2` and `iChannel3` are automatically maintained by the library render context. The host is responsible for updating other uniforms, -such as `iFrame`, `iGlobalTime` and such. +such as `iFrame`, `iTime` and such. ## Building the examples diff --git a/examples/10-gradient/main.cpp b/examples/10-gradient/main.cpp index e491f81..5818654 100644 --- a/examples/10-gradient/main.cpp +++ b/examples/10-gradient/main.cpp @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) while (t < 5.) { // Update uniforms - context.GetState().V<shadertoy::iGlobalTime>() = t; + context.GetState().V<shadertoy::iTime>() = t; context.GetState().V<shadertoy::iFrame>() = frameCount; // Render to texture diff --git a/examples/10-gradient/shader.glsl b/examples/10-gradient/shader.glsl index 2b75674..e0aa1f3 100644 --- a/examples/10-gradient/shader.glsl +++ b/examples/10-gradient/shader.glsl @@ -1,5 +1,5 @@ void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord.xy / iResolution.xy; - fragColor = vec4(uv,0.5+0.5*sin(iGlobalTime),1.0); + fragColor = vec4(uv,0.5+0.5*sin(iTime),1.0); } diff --git a/include/shadertoy/UniformState.hpp b/include/shadertoy/UniformState.hpp index b142d00..6c0dcdd 100644 --- a/include/shadertoy/UniformState.hpp +++ b/include/shadertoy/UniformState.hpp @@ -319,7 +319,7 @@ namespace shadertoy /// Default program state typedef typedef ShaderInputs< iResolution, - iGlobalTime, + iTime, iTimeDelta, iFrame, iFrameRate, diff --git a/include/shadertoy/UniformState_impl.hpp b/include/shadertoy/UniformState_impl.hpp index 1188ed9..2eb8156 100644 --- a/include/shadertoy/UniformState_impl.hpp +++ b/include/shadertoy/UniformState_impl.hpp @@ -7,7 +7,7 @@ namespace shadertoy DECLARE_UNIFORM(oglplus::Vec3f, iResolution, "vec3"); // Current time in seconds -DECLARE_UNIFORM(GLfloat, iGlobalTime, "float"); +DECLARE_UNIFORM(GLfloat, iTime, "float"); // Time it takes to render a frame, in seconds DECLARE_UNIFORM(GLfloat, iTimeDelta, "float"); -- GitLab