Skip to content

Add new shapes to GaeaNodeFalloff#367

Merged
BenjaTK merged 3 commits intogaea-godot:2.0from
Zehir:falloff
May 5, 2025
Merged

Add new shapes to GaeaNodeFalloff#367
BenjaTK merged 3 commits intogaea-godot:2.0from
Zehir:falloff

Conversation

@Zehir
Copy link
Collaborator

@Zehir Zehir commented Apr 29, 2025

Rework falloff node with new shapes

Description

This PR is a rework of the falloff node with some new features and bug fix.

Because an image is still better then a lot of words, here the old node and the new node. In the screenshot beflow the FalloffMap2 is the new version of the FalloffMap.

There is now 4 shapes included with the node. I did not include each variation in the add node tree, just the basic FalloffMap node like before.

  • Square, like before just a square
  • Rounded Square, a square but with round corner
  • Circle, just a circle
  • Squircle, a circle in the middle but a rounded square on the border.

Sample images

image
image
image

Works also with lower "resolution", the old one had an offset issue that is now fixed;
image

It's also support non square shapes (I used the PR #366 for the preview);

image
image

Q&A

  • Why there is that many var defined in the FalloffSampler class ?
  • It's because of performances. It's some calculation that need to be do only once and not for each cell.

Performance tests

I tried to generate a big grid and it's taking in average 530 ms to generate the data.
I tried without all var it's taking 550 ms in average
I also tried with a PackedFloat32Array but was worse: 580 ms

For a standard grid of 64*64 it's taking 4 ms

References

https://old.reddit.com/r/proceduralgeneration/comments/kaen7h/new_video_on_procedural_island_noise_generation/gfjmgen/
https://www.redblobgames.com/maps/terrain-from-noise/#islands

@cullumi cullumi added the ✨ enhancement New feature or request label May 1, 2025
@cullumi cullumi added this to the v2.0.0-stable milestone May 1, 2025
@BenjaTK BenjaTK changed the title Rework falloff node with new shapes Add new shapes to GaeaNodeFalloff May 1, 2025
@BenjaTK
Copy link
Collaborator

BenjaTK commented May 1, 2025

The squircle should probably be removed, rounded square does almost entirely the same

@Zehir
Copy link
Collaborator Author

Zehir commented May 1, 2025

The squircle should probably be removed, rounded square does almost entirely the same

I would prefer keep it because it's not exactly the same and it's just 3 more lines of code

@cullumi
Copy link
Collaborator

cullumi commented May 2, 2025

The squircle should probably be removed, rounded square does almost entirely the same

I would prefer keep it because it's not exactly the same and it's just 3 more lines of code

There's probably no real downsides to holding onto, yeah. While the differences are subtle, they are technically different.

@Zehir Zehir requested a review from BenjaTK May 2, 2025 19:52
Copy link
Collaborator

@BenjaTK BenjaTK left a comment

Choose a reason for hiding this comment

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

Missing hints for start and end to be withing 0.0-1.0.

@Zehir
Copy link
Collaborator Author

Zehir commented May 5, 2025

Missing hints for start and end to be withing 0.0-1.0.

They should not be clamped to 0.0-1.0, you may want use values outside the "standard" range
image

@Zehir Zehir requested a review from BenjaTK May 5, 2025 06:52
Copy link
Collaborator

@BenjaTK BenjaTK left a comment

Choose a reason for hiding this comment

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

LGTM

@BenjaTK BenjaTK merged commit 6c0afdb into gaea-godot:2.0 May 5, 2025
@Zehir Zehir deleted the falloff branch May 5, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants