Day Progress
How far through the day it is (0 at midnight, 1 at the next), and how light it is outside: 1 between Sunrise and Sunset, fading over an hour.
●Day Progress
Sunrise6Day Fraction
Sunset20Daylight
Inputs
| Pin | Type | Starts at | Notes |
|---|---|---|---|
Sunrisesunrise | float | 6 | – |
Sunsetsunset | float | 20 | – |
Outputs
| Pin | Type |
|---|---|
Day Fractionday | float |
Daylightlight | float |
The code it becomes
What Studio writes for the graph below: a few lines of the material's shader, worked out for every pixel.
void mainImage(out vec4 fragColor, in vec2 fragCoord){ float n2_day = (iDate.w / 86400.0); float n2_light = (smoothstep(6.0 - 0.5, 6.0 + 0.5, (iDate.w / 3600.0)) * (1.0 - smoothstep(20.0 - 0.5, 20.0 + 0.5, (iDate.w / 3600.0)))); fragColor = vec4(vec3(n2_day), 1.0);}In a graph
●Day Progress
Sunrise6Day Fraction
Sunset20Daylight
◎Material OutputEnds here
Colour
Alpha1
Texture coordinates into the node, and the node into the material, as Studio draws them.
Related
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.