This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Compute exp(x) - 1 without loss of precision for small values of x. | |
## https://www.johndcook.com/blog/cpp_expm1/ | |
## | |
## usage for exponential smoothing in games/animation e.g.: | |
## for any value of dt (delta time): | |
## | |
## position += (target - position) * (1 - exp(- speed * dt)) | |
## | |
## changed to use -expm1(x) instead of 1-exp(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tool | |
extends NoiseTexture2D | |
class_name BakeableNoiseTexture2D | |
# | |
# Custom class for bakeable NoiseTexture2D resource | |
# | |
# based on code by @fabimakesgames.bsky.social | |
# https://gist.github.com/nan0m/c280761802c6dfc86533d1de89d27dae | |
# bsky post: https://bsky.app/profile/fabimakesgames.bsky.social/post/3ld4teamupk2i |