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

Remove useless exponentiation in fbm by multiplying the value in the loop #310

Merged
merged 1 commit into from
Mar 11, 2023

Conversation

bertin0
Copy link
Contributor

@bertin0 bertin0 commented Mar 9, 2023

Fixes #299

@Razaekel Razaekel force-pushed the remove-useless-exponent branch from 5a3daf8 to 825694e Compare March 11, 2023 17:57
@Razaekel Razaekel merged commit 14f231e into Razaekel:develop Mar 11, 2023
@PrinceOfBorgo
Copy link
Contributor

PrinceOfBorgo commented Dec 9, 2023

The fix is wrong. Multiplying attenuation by itself at each iteration produces persistence ^ (2 ^ (x + 1)) and not persistence ^ (x + 1). The fix is to multiply attenuation by self.persistance instead.

// Increase the attenuation for the next octave, to be equal to persistence ^ (x + 1)
attenuation *= self.persistence;

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

Successfully merging this pull request may close these issues.

fbm can be a lot faster
3 participants