Hacker News new | ask | show | jobs
by ortichic 928 days ago
I like the effect, but is there a way to make it independent of the zoom level?

On a related note, this probably adds randomness, is there a way to seed it? For example to be able to define a single correct render result at a given size.

2 comments

Author here, yes there is! The underlying algorithm and implementation in SVG accepts a seed value: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/s...
I am on phone and can not see the noise in the final image at all. I think its there but when I zoom in, it feels like it disappears. You should probably consider making it bigger or independent of zoom for the sake of mobile viewers.
As the other comment mentions, yes there is a seed attribute, also the algorithm for the randomness function is defined in the specification as 186 lines of C code[0], so in theory different implementations should behave the same.

Although looking at the cod, it uses floating point math, which I believe is implementation defined, so maybe it could behave differently on various platforms.

[0]: https://drafts.fxtf.org/filter-effects/#elementdef-feturbule...