opengl: Bug fix: div 0 in shader

This commit is contained in:
Hajime Hoshi 2016-06-26 15:57:45 +09:00
parent 891ad34d88
commit f537378f2a

View File

@ -59,7 +59,9 @@ void main(void) {
lowp vec4 color = texture2D(texture, vertex_out_tex_coord);
// Un-premultiply alpha
color.rgb /= color.a;
if (0.0 < color.a) {
color.rgb /= color.a;
}
// Apply the color matrix
color = (color_matrix * color) + color_matrix_translation;
color = clamp(color, 0.0, 1.0);