From b738e7e70f1853ab2af94266c0b7b0b1a821cfad Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 25 Nov 2019 22:57:56 -0800 Subject: 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. --- src/libs/din/din.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libs') 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; } -- cgit v1.2.3