Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion effects/seriously.chroma.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'uniform float clipBlack;',
'uniform float clipWhite;',
'uniform bool mask;',
'uniform float clipPrecision;',

'varying float screenSat;',
'varying vec3 screenPrimary;',
Expand Down Expand Up @@ -101,7 +102,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) / max(0.00001, alpha), alpha);',
' vec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(clipPrecision, alpha), alpha);',

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

Expand Down Expand Up @@ -170,6 +171,13 @@
defaultValue: false,
uniform: 'mask',
shaderDirty: true
},
precision: {
type: 'float',
uniform: 'clipPrecision',
defaultValue: 0.00001,
min: 0.00001,
max: 1.0
}
},
title: 'Chroma Key',
Expand Down