Update JINC2 to prevent NaN, which result in black texture in some cases

This commit is contained in:
JS Deck 2020-09-02 04:03:36 -03:00
parent 2832709da6
commit f83591434f
4 changed files with 6004 additions and 6025 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;
}