Hacker News new | past | comments | ask | show | jobs | submit login

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.




The 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.


You can use a similar approach for adding time features to a ML model. In this context, I think it is a quite common technique.


Every 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.


It's a little bit of both, probably?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: