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

FastNoiseLite: Fix cellular jitter using incorrect default value #79922

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

Auburn
Copy link
Contributor

@Auburn Auburn commented Jul 26, 2023

Hi I'm the creator of the FastNoiseLite library, I was looking through the godot usage of it and I noticed this error. It seems to be a relic from the original godot PR for FastNoise which was originally based on FastNoise legacy where the default was 0.45

Default value for cellular jitter should be 1.0, using 0.45 will make the cellular noise have an overly grid shaped appearance

Cellular Jitter = 0.45
cellular0_45

Cellular Jitter = 1.0
cellular1_0

The other issue I see is that the OpenSimplex noise type is just named Simplex, which is a disservice to @KdotJPG who created the open license OpenSimplex algorithms. This is obviously a harder thing to fix though because it would cause breaking changes to existing code

@YuriSizov YuriSizov changed the title FastNoiseLite Fix cellular jitter using incorrect default value FastNoiseLite: Fix cellular jitter using incorrect default value Jul 26, 2023
@YuriSizov YuriSizov added this to the 4.2 milestone Jul 26, 2023
@YuriSizov YuriSizov requested a review from Geometror July 26, 2023 13:21
@YuriSizov
Copy link
Contributor

Thanks for opening a PR. You need to update the documentation as well. Since it's just a change in the default value, you can simply run the doctool with a binary that you've compiled from your changes. See the documentation.

@Auburn
Copy link
Contributor Author

Auburn commented Jul 26, 2023

I haven't even cloned the godot repo I just made the change on github 😅 is that an easy thing for someone else to do?

Default value for cellular jitter should be 1.0, using 0.45 will make the cellular noise look bad
@RedworkDE RedworkDE force-pushed the cellular-jitter-fix branch from cd5a1f0 to 8649ab8 Compare July 26, 2023 17:51
@YuriSizov
Copy link
Contributor

is that an easy thing for someone else to do?

Yes, totally. Godot is very easy to compile. You can follow the documentation for your platform here: https://docs.godotengine.org/en/stable/contributing/development/compiling/index.html

That said, @RedworkDE graciously made the change on your behalf.

Copy link
Member

@Geometror Geometror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for stopping by :)
Changing the default value should be fine.
Regarding OpenSimplex noise: Renaming the enum values of course is problematic due to compatibility breakage (at least for Godot 4.x), but maybe we can honor @KdotJPG's work in the documentation by explaining that it uses the open license simplex noise algorithms.
This would also be shown inside the tooltip in the editor:

grafik

@Auburn
Copy link
Contributor Author

Auburn commented Jul 27, 2023

That sounds like a good solution 👍

@KdotJPG
Copy link
Contributor

KdotJPG commented Aug 3, 2023

Oh, I appreciate the looking out!

I'm actually chill with the noises being labeled "Simplex", and definitely don't think I need any special callout in the node documentation 😛. I care more that users have access to good quality noise, whatever the authorship may be, and are provided accurate information on the pros and cons.

The 2D case used for TYPE_SIMPLEX is an implementation of plain Simplex anyway, as that wasn't covered by the at-the-time-active US patent, and because it performed better than the canonical extension of OpenSimplex2 to 2D. The 3D TYPE_SIMPLEX is a custom algorithm, as are both the 2D and 3D cases of TYPE_SIMPLEX_SMOOTH.

If you want to give users of the feature more insight on the internals, your suggestion to clarify the implementation/nature in the documentation sounds good to me.


On this topic, though, I do think it would be worth changing the order of the entries in the documentation. One of the philosophies considered during FNL's development was to sort the noises by recommended usage consideration order, rather than implementation simplicity or time of invention. The original ordering can be found in the enum.

@Calinou
Copy link
Member

Calinou commented Aug 3, 2023

On this topic, though, I do think it would be worth changing the order of the entries in the documentation. One of the philosophies considered during FNL's development was to sort the noises by recommended usage consideration order, rather than implementation simplicity or time of invention. The original ordering can be found in the enum.

We can't change the enum's order without breaking compatibility, and we shouldn't make a special case for enum order in the documentation (it should always follow code ordering for consistency).

@KdotJPG
Copy link
Contributor

KdotJPG commented Aug 3, 2023

We can't change the enum's order without breaking compatibility, and we shouldn't make a special case for enum order in the documentation (it should always follow code ordering for consistency).

Hmm, is the enum order not TYPE_SIMPLEX, TYPE_SIMPLEX_SMOOTH, TYPE_CELLULAR, TYPE_PERLIN, TYPE_VALUE_CUBIC, TYPE_VALUE?

The enum is already in the order I'm suggesting, but the tooltip documentation under property noise_type does not reflect it.

@YuriSizov
Copy link
Contributor

Yes indeed, the order of registration for enum values is wrong.

BIND_ENUM_CONSTANT(TYPE_VALUE);
BIND_ENUM_CONSTANT(TYPE_VALUE_CUBIC);
BIND_ENUM_CONSTANT(TYPE_PERLIN);
BIND_ENUM_CONSTANT(TYPE_CELLULAR);
BIND_ENUM_CONSTANT(TYPE_SIMPLEX);
BIND_ENUM_CONSTANT(TYPE_SIMPLEX_SMOOTH);

@KdotJPG
Copy link
Contributor

KdotJPG commented Aug 7, 2023

Looking further, I do see more opportunity to clarify the documentation on the actual functionality and effects of the options. For example,

	<constant name="FRACTAL_RIDGED" value="2" enum="FractalType">
		Method of combining octaves into a fractal resulting in a "ridged" look.
	</constant>

could be reworded as

	<constant name="FRACTAL_RIDGED" value="2" enum="FractalType">
		Method similar to [constant FRACTAL_FBM] where each layer is passed into a flipped absolute value function.
		Results in a mountainous "ridged" apppearance.
	</constant>

and

	<constant name="DOMAIN_WARP_SIMPLEX" value="0" enum="DomainWarpType">
		The domain is warped using the simplex noise algorithm.
	</constant>

could be changed to

	<constant name="DOMAIN_WARP_SIMPLEX" value="0" enum="DomainWarpType">
		The domain is warped using a modified version of the simplex noise algorithm which outputs vectors.
	</constant>

I wouldn't mind making my own PR for all of this. That way we don't need any further documentation changes in this one.

@akien-mga akien-mga merged commit 4332a79 into godotengine:master Aug 17, 2023
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

I wouldn't mind making my own PR for all of this. That way we don't need any further documentation changes in this one.

Yes, please do :)

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

Successfully merging this pull request may close these issues.

6 participants