diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2019-11-25 22:57:56 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2019-11-25 22:57:56 -0800 |
commit | b738e7e70f1853ab2af94266c0b7b0b1a821cfad (patch) | |
tree | 6f948d2c48d368f5899d40dde39987f093160a56 /src/libs/din | |
parent | c2e8c60b733cc761ef9afb9c7f99f26e92abe156 (diff) |
din: scale result
I'd like the output to fill the range -1..+1, but it's not doing that and I'm
uncertain on what exactly the scaling factor should be here.
In one reference a factor of 1/sqrt(.75) is specified, but in my tests that
doesn't seem to quite fill the range but it doesn't seem to blow it out so
it seems safe for now.
Diffstat (limited to 'src/libs/din')
-rw-r--r-- | src/libs/din/din.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/din/din.c b/src/libs/din/din.c index caa7c72..02f8ea6 100644 --- a/src/libs/din/din.c +++ b/src/libs/din/din.c @@ -143,5 +143,5 @@ float din(din_t *din, v3f_t *coordinate) tz = smootherstep(0.f, 1.f, tz); - return lerp(ii1, ii2, tz); + return lerp(ii1, ii2, tz) * 1.1547005383792515290182975610039f; } |