Skip to content

Commit 9fdfd60

Browse files
committed
Add 0 check before dividing color by alpha
1 parent d1f33db commit 9fdfd60

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)