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

Implementation issues #5

Open
mfiano opened this issue Feb 11, 2021 · 5 comments
Open

Implementation issues #5

mfiano opened this issue Feb 11, 2021 · 5 comments

Comments

@mfiano
Copy link

mfiano commented Feb 11, 2021

Hello, and thank you for all your work. I am in the process of porting these various algorithms to Common Lisp. So far I ported 2F 2D, and I'm currently wondering if my 2F 3D implementation is correct. It seems to look too regular compared to your examples, though they do share some similarities. This is difficult to debug, as I'm not seeing any graphical artifacts or anything. I am not sure if what I have looks correct or not after staring at it for so long. Below is a 2D slice of 2F 3D XY/Z, though results look pretty similar to Classic. For completion, I also provided an animated gif, moving through the third axis. My goal is to finish a correct implementation in Common Lisp, so that I can submit a PR to your repository. Thank you for your help.

Edit: My version seems to be very sparse compared to yours, with features packed much more closer together in yours.

GIF Animation

@mfiano
Copy link
Author

mfiano commented Feb 11, 2021

Cancel that. The issue was a typo of the wrong XOR argument in the lattice point tree, so it was choosing the wrong success branch after the first iteration.

Anyway, once I finish with this port in a day or two, would you want to add a not so common language port to your collection, or should it go in the readme as a link? :)

@mfiano
Copy link
Author

mfiano commented Feb 13, 2021

I finished impleementing them all, and will be publishing the code soon after some more optimization work, so far the results outperform C# (on my particular hardware), but there is still room for improvement. Here are the results so far:

(10 million iterations) Common Lisp CSharp Diff
OpenSimplex2F 2D 0.376s 0.547s 1.45x
OpenSimplex2F 3D 0.496s 0.806s 1.62x
OpenSimplex2F 4D 0.760s 1.758s 2.31x
OpenSimplex2S 2D 0.476s 0.622s 1.30x
OpenSimplex2S 3D 0.680s 1.085s 1.59x
OpenSimplex2S 4D 1.073s 2.044s 1.90x

Edit: Optimizations improved speed

@KdotJPG
Copy link
Owner

KdotJPG commented Apr 28, 2021

Cool to hear! Interested in seeing the final result. I will soon be updating this repo with faster versions of the noise based on what I wrote for FastNoiseLite (https://github.com/Auburn/FastNoiseLite), so I wonder how that will affect the comparison.

@george-tsiros
Copy link

did not want to open a new topic
output values are in [-1, 1] , correct?

@KdotJPG
Copy link
Owner

KdotJPG commented May 21, 2021

Yes

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

No branches or pull requests

3 participants