Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analytical derivatives? #57

Open
jonikorpi opened this issue Dec 12, 2022 · 1 comment
Open

Analytical derivatives? #57

jonikorpi opened this issue Dec 12, 2022 · 1 comment
Labels

Comments

@jonikorpi
Copy link

jonikorpi commented Dec 12, 2022

Any chance you might add an (optional) way to get analytical derivatives for the noise result?

Derivatives are handy because they tell you the ”slope” of the noise, which is incredibly useful for use cases like terrain generation. It’s possible to manually calculate them by sampling the noise 3+ times, but (as I understand it) analytical derivatives are much cheaper to compute.

As a reference, I’ve found these implementations:

I’ve explored adding them myself and making a PR, but honestly I’m a bit out of my depth here. :)

@jwagner
Copy link
Owner

jwagner commented Dec 14, 2022

Hi Joni,

Thanks for the suggestion.

I'd love to have analytical derrivatives in. With simplex-noise now being tree-shakeable there shouldn't be a size penalty and they can definitely be useful.

As far as I know they have been used in my favorite demo https://www.youtube.com/watch?v=jB0vBmiTr6o :)
https://blog.datalets.ch/workshops/2016/scoda_016/iquilezles-function2009.pdf

I don't have time to familiarize myself with the code enough (again) but I'm happy to add it as a todo. If anyone else wants to give it a shot I'd be happy to review and merge it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants