Skip to content

Commit ad777f2

Browse files
authored
Merge pull request #7478 from processing/fix/nan-colors
Add 0 check before dividing color by alpha
2 parents 2ec3557 + 9fdfd60 commit ad777f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/webgl/shaders/phong.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void main(void) {
4949
inputs.color = isTexture
5050
? TEXTURE(uSampler, vTexCoord) * uTint/255.
5151
: vColor;
52-
if (isTexture) {
52+
if (isTexture && inputs.color.a > 0.0) {
5353
// Textures come in with premultiplied alpha. Temporarily unpremultiply it
5454
// so hooks users don't have to think about premultiplied alpha.
5555
inputs.color.rgb /= inputs.color.a;

0 commit comments

Comments
 (0)