4 ms·
i have been doing this for a while playing around with shadertoy. i don't think i learned it from anywhere, i just wanted some things to match up and repeat ove
by ruined 5y ago
i have been doing this for a while playing around with shadertoy. i don't think i learned it from anywhere, i just wanted some things to match up and repeat over hours and it was obvious that sin/cos are periodic, and cycling the time value would improve the imprecision at the seam.
seeing it delivered as a clever trick in a blog post makes me wonder if i'm more competent than i thought, or if everyone else is generally less competent than i thought.
- EveYoung 5y agoYou can use a similar approach for adding time features to a ML model. In this context, I think it is a quite common technique.
- sgtnoodle 5y agoIt's a little bit of both, probably?
- josephg 5y agoEvery now and then I have to remind myself that things that are obvious to me aren't obvious to everyone else. And thus, sometimes its worth explaining "obvious" things. This is probably true for everyone.
- Etherlord87 5y agoThe trick isn't so much about looping the sine/cosine. It's about setting synchronizing the maximum time value passed to a shader, with maximum precision of an arbitrary multiplicand used in the shader. > How do we ensure that, easily, in a way that people don't have to think about? The relation is that the time should switch from 10^x to 0, and in the shader the number of digits after a dot should be no more than x.