mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
opengl: Bug fix: div 0 in shader
This commit is contained in:
parent
891ad34d88
commit
f537378f2a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user