Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.73k stars 320 forks source link

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

Closed MAGGen-hub closed 9 months ago

MAGGen-hub commented 9 months ago

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

Auburn commented 9 months ago

Thanks, fixes look good 👍

MAGGen-hub commented 9 months ago

Thank you, too.