Skip to content

Commit

Permalink
Fix division by zero error in shader
Browse files Browse the repository at this point in the history
  • Loading branch information
maiself committed Apr 2, 2016
1 parent fd0f4fd commit 535d547
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ const InvertWindowEffect = new Lang.Class({
uniform sampler2D tex; \
void main() { \
vec4 color = texture2D(tex, cogl_tex_coord_in[0].st); \
color.rgb /= color.a; \
if(color.a > 0.0) { \
color.rgb /= color.a; \
} \
color.rgb = vec3(1.0, 1.0, 1.0) - color.rgb; \
color.rgb *= color.a; \
cogl_color_out = color * cogl_color_in; \
Expand Down

0 comments on commit 535d547

Please sign in to comment.