mrdoob / texgen.js

JavaScript Texture Generator
http://texgenjs.org/
MIT License
1.8k stars 130 forks source link

Fixed repeat for gradients #26

Closed DGruenwald closed 9 years ago

DGruenwald commented 9 years ago

I realized that I totally botched the repeat for the interpolator when I added the gradient-map filter and fixed it here.

I also tried to add a mirrored repeat mode but, while it usually works like intended, sometimes it flips one pixel too early or late and returns a wrong color:

error

I think this is a precision issue, since, when the color positions get changed a little, it doesn't happen:

noterror

So the question is now, is there a solution to this or should I scrap it?

DGruenwald commented 9 years ago

I decided to remove the mirrored repeat because of the bug above.

mrdoob commented 9 years ago

Sounds good. The simpler the code the better :)