Skip to content

Commit

Permalink
Fix divide-by-zero bug in chroma effect #80
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchirls committed Jan 13, 2015
1 parent 10155cf commit fd10634
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion effects/seriously.chroma.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
*/
' float alpha = max(0.0, 1.0 - pixelSat / screenSat);',
' alpha = smoothstep(clipBlack, clipWhite, alpha);',
' vec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / alpha, alpha);',
' vec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);',

' vec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);',

Expand Down

0 comments on commit fd10634

Please sign in to comment.