Merge pull request #713 from xzn/jinc2_nan

Update JINC2 to prevent NaN, which result in black texture in some cases
This commit is contained in:
Autechre 2020-09-02 17:47:17 +02:00 committed by GitHub
commit 2bc4d0161e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6007 additions and 6026 deletions

File diff suppressed because it is too large Load Diff

View File

@ -557,7 +557,8 @@ vec4 resampler(vec4 x)
{
vec4 res;
res = (x==vec4(0.0, 0.0, 0.0, 0.0)) ? vec4(wa*wb) : sin(x*wa)*sin(x*wb)/(x*x);
// Need to use mix(.., equal(..)) since we want zero check to be component wise
res = mix(sin(x*wa)*sin(x*wb)/(x*x), vec4(wa*wb), equal(x,vec4(0.0, 0.0, 0.0, 0.0)));
return res;
}

View File

@ -699,7 +699,9 @@ vec4 resampler(vec4 x)
{
vec4 res;
res = (x==vec4(0.0, 0.0, 0.0, 0.0)) ? vec4(wa*wb) : sin(x*wa)*sin(x*wb)/(x*x);
// res = (x==vec4(0.0, 0.0, 0.0, 0.0)) ? vec4(wa*wb) : sin(x*wa)*sin(x*wb)/(x*x);
// Need to use mix(.., equal(..)) since we want zero check to be component wise
res = mix(sin(x*wa)*sin(x*wb)/(x*x), vec4(wa*wb), equal(x,vec4(0.0, 0.0, 0.0, 0.0)));
return res;
}