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

Bug fixes for OpenSimplex2S Noise 2D (GLSL) and Value Cubic Noise 3D (GLSL and HLSL) #127

Merged
merged 3 commits into from Jan 3, 2024

Conversation

MAGGen-hub
Copy link
Contributor

Dear developers of FastNoiseLite Libruary.
I am working on custom plugin for Godot Game Engine that will allow usage of FastNoiseLite libruary on GPU device to provide noise data at runtime without visible delays and freezes.

I runned some tests in Godot and Shadertoy and found a few bugs in _fnlSingleOpenSimplex2S2D (In GLSL version only) and _fnlSingleValueCubic3D (In GLSL and HLSL versions) functions.

OpenSimplex2S Noise 2D (GLSL) before bug fix:
image

After bug fix:
image

Value Cubic Noise 3D (GLSL) before bug fix:
image

After bug fix (equal to output of C++ and https://auburn.github.io/FastNoiseLite/ versions):
image

According to my current tests - other Noises (and functions) in GLSL are 99.9% equal to Noises created by C++ version of FastNoiseLite provided by Godot:
image

If I found more bugs during plugin development I will try to inform you about them and seek for posible solutions...

Thank you for your attention and sorry for my bad English. Good luck in future development.

P.S. : Code I created for Shadertoy(https://www.shadertoy.com/) for testing and demonstration:
FastNoiseLite-ShadertoyTest.txt

In GLSL version OpenSimplex2S2D was divided into rhombic fragments. This fix was based on HLSL version code, that has no fragmentation bug: see https://github.com/Auburn/FastNoiseLite/blob/df34389c6b3cbba88fd7caf9d376587ebcb31522/HLSL/FastNoiseLite.hlsl#L1059C22-L1059C22
In GLSL version ValueCubic3D produced values that was outside of default color ramp. This fix was based on C++ version code, that has no contrast bug: see https://github.com/Auburn/FastNoiseLite/blob/df34389c6b3cbba88fd7caf9d376587ebcb31522/Cpp/FastNoiseLite.h#L1914
In HLSL version ValueCubic3D produced values that was outside of default color ramp. This fix was based on C++ version code, that has no contrast bug: see https://github.com/Auburn/FastNoiseLite/blob/df34389c6b3cbba88fd7caf9d376587ebcb31522/Cpp/FastNoiseLite.h#L1914
@MAGGen-hub MAGGen-hub changed the title Bug fixes for OpenSimplex2S Noise 2D and Value Cubic Noise 3D Bug fixes for OpenSimplex2S Noise 2D (GLSL) and Value Cubic Noise 3D (GLSL and HLSL) Jan 2, 2024
@Auburn Auburn merged commit ba3d86b into Auburn:master Jan 3, 2024
@Auburn
Copy link
Owner

Auburn commented Jan 3, 2024

Thanks, fixes look good 👍

@MAGGen-hub
Copy link
Contributor Author

Thank you, too.

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.

None yet

2 participants