Date
Today: the year, the month (1 to 12), the day of the month and the day of the week (0 is Monday).
●Date
Year
Month
Day
Day of Week
Inputs
None.
Outputs
| Pin | Type |
|---|---|
Yearyear | float |
Monthmonth | float |
Dayday | float |
Day of Weekweekday | 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_year = iDate.x; float n2_month = (iDate.y + 1.0); float n2_day = iDate.z; float n2_weekday = mod(iDate.z + floor(2.6 * (mod(iDate.y + 10.0, 12.0) + 1.0) - 0.2) + mod((iDate.x - (iDate.y < 2.0 ? 1.0 : 0.0)), 100.0) + floor(mod((iDate.x - (iDate.y < 2.0 ? 1.0 : 0.0)), 100.0) / 4.0) + floor((iDate.x - (iDate.y < 2.0 ? 1.0 : 0.0)) / 400.0) - 2.0 * floor((iDate.x - (iDate.y < 2.0 ? 1.0 : 0.0)) / 100.0) + 6.0, 7.0); fragColor = vec4(vec3(n2_year), 1.0);}In a graph
●Date
Year
Month
Day
Day of Week
◎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.