removed old unused blend mode files

This commit is contained in:
itsmattkc
2019-03-27 01:14:45 +11:00
parent ad1013e60b
commit 8b400d7b31
27 changed files with 57 additions and 383 deletions
-14
View File
@@ -1,14 +0,0 @@
float blendAdd(float base, float blend) {
return min(base+blend,1.0);
}
vec3 blendAdd(vec3 base, vec3 blend) {
return min(base+blend,vec3(1.0));
}
vec3 blendAdd(vec3 base, vec3 blend, float opacity) {
return (blendAdd(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendAdd)
#olive name Add
-10
View File
@@ -1,10 +0,0 @@
vec3 blendAverage(vec3 base, vec3 blend) {
return (base+blend)/2.0;
}
vec3 blendAverage(vec3 base, vec3 blend, float opacity) {
return (blendAverage(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendAverage)
#olive name Average
-14
View File
@@ -1,14 +0,0 @@
float blendColorBurn(float base, float blend) {
return (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);
}
vec3 blendColorBurn(vec3 base, vec3 blend) {
return vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));
}
vec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {
return (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendColorBurn)
#olive name Color Burn
-14
View File
@@ -1,14 +0,0 @@
float blendColorDodge(float base, float blend) {
return (blend==1.0)?blend:min(base/(1.0-blend),1.0);
}
vec3 blendColorDodge(vec3 base, vec3 blend) {
return vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));
}
vec3 blendColorDodge(vec3 base, vec3 blend, float opacity) {
return (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendColorDodge)
#olive name Color Dodge
-14
View File
@@ -1,14 +0,0 @@
float blendDarken(float base, float blend) {
return min(blend,base);
}
vec3 blendDarken(vec3 base, vec3 blend) {
return vec3(blendDarken(base.r,blend.r),blendDarken(base.g,blend.g),blendDarken(base.b,blend.b));
}
vec3 blendDarken(vec3 base, vec3 blend, float opacity) {
return (blendDarken(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendDarken)
#olive name Darken
-10
View File
@@ -1,10 +0,0 @@
vec3 blendDifference(vec3 base, vec3 blend) {
return abs(base-blend);
}
vec3 blendDifference(vec3 base, vec3 blend, float opacity) {
return (blendDifference(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendDifference)
#olive name Difference
+57 -36
View File
@@ -133,50 +133,71 @@ void load_internal_effects() {
void load_shader_effects_worker(const QString& effects_path) {
QDir effects_dir(effects_path);
if (effects_dir.exists()) {
QList<QString> entries = effects_dir.entryList(QStringList("*.xml"), QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
QList<QString> entries = effects_dir.entryList({"*.xml", "*.blend"},
QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
for (int i=0;i<entries.size();i++) {
QString entry_path = effects_dir.filePath(entries.at(i));
if (QFileInfo(entry_path).isDir()) {
load_shader_effects_worker(entry_path);
} else {
QFile file(effects_path + "/" + entries.at(i));
if (!file.open(QIODevice::ReadOnly)) {
qCritical() << "Could not open" << entries.at(i);
return;
}
QString file_url = QDir(effects_path).filePath(entries.at(i));
QXmlStreamReader reader(&file);
while (!reader.atEnd()) {
if (reader.name() == "effect") {
QString effect_name = "";
QString effect_cat = "";
const QXmlStreamAttributes attr = reader.attributes();
for (int j=0;j<attr.size();j++) {
if (attr.at(j).name() == "name") {
effect_name = attr.at(j).value().toString();
} else if (attr.at(j).name() == "category") {
effect_cat = attr.at(j).value().toString();
}
}
if (!effect_name.isEmpty()) {
EffectMeta em;
em.type = EFFECT_TYPE_EFFECT;
em.subtype = EFFECT_TYPE_VIDEO;
em.name = effect_name;
em.category = effect_cat;
em.filename = file.fileName();
em.path = effects_path;
em.internal = -1;
olive::effects.append(em);
} else {
qCritical() << "Invalid effect found in" << entries.at(i);
}
break;
if (file_url.endsWith(".blend", Qt::CaseInsensitive)) {
// Load blending mode shaders from file
QList<QString> blend_mode_entries = effects_dir.entryList(QStringList("*.blend"), QDir::Files);
for (int i=0;i<blend_mode_entries.size();i++) {
BlendMode b;
b.loaded = false;
b.url = effects_dir.filePath(blend_mode_entries.at(i));
b.name = QFileInfo(b.url).baseName();
olive::blend_modes.append(b);
}
reader.readNext();
}
file.close();
} else {
QFile file(file_url);
if (!file.open(QIODevice::ReadOnly)) {
qCritical() << "Could not open" << entries.at(i);
return;
}
QXmlStreamReader reader(&file);
while (!reader.atEnd()) {
if (reader.name() == "effect") {
QString effect_name = "";
QString effect_cat = "";
const QXmlStreamAttributes attr = reader.attributes();
for (int j=0;j<attr.size();j++) {
if (attr.at(j).name() == "name") {
effect_name = attr.at(j).value().toString();
} else if (attr.at(j).name() == "category") {
effect_cat = attr.at(j).value().toString();
}
}
if (!effect_name.isEmpty()) {
EffectMeta em;
em.type = EFFECT_TYPE_EFFECT;
em.subtype = EFFECT_TYPE_VIDEO;
em.name = effect_name;
em.category = effect_cat;
em.filename = file.fileName();
em.path = effects_path;
em.internal = -1;
olive::effects.append(em);
} else {
qCritical() << "Invalid effect found in" << entries.at(i);
}
break;
}
reader.readNext();
}
file.close();
}
}
}
}
-10
View File
@@ -1,10 +0,0 @@
vec3 blendExclusion(vec3 base, vec3 blend) {
return base+blend-2.0*base*blend;
}
vec3 blendExclusion(vec3 base, vec3 blend, float opacity) {
return (blendExclusion(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendExclusion)
#olive name Exclusion
-12
View File
@@ -1,12 +0,0 @@
#pragma glslify: blendReflect = require(./reflect)
vec3 blendGlow(vec3 base, vec3 blend) {
return blendReflect(blend,base);
}
vec3 blendGlow(vec3 base, vec3 blend, float opacity) {
return (blendGlow(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendGlow)
#olive name Glow
-12
View File
@@ -1,12 +0,0 @@
#pragma glslify: blendOverlay = require(./overlay)
vec3 blendHardLight(vec3 base, vec3 blend) {
return blendOverlay(blend,base);
}
vec3 blendHardLight(vec3 base, vec3 blend, float opacity) {
return (blendHardLight(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendHardLight)
#olive name Hard Light
-16
View File
@@ -1,16 +0,0 @@
#pragma glslify: blendVividLight = require(./vivid-light)
float blendHardMix(float base, float blend) {
return (blendVividLight(base,blend)<0.5)?0.0:1.0;
}
vec3 blendHardMix(vec3 base, vec3 blend) {
return vec3(blendHardMix(base.r,blend.r),blendHardMix(base.g,blend.g),blendHardMix(base.b,blend.b));
}
vec3 blendHardMix(vec3 base, vec3 blend, float opacity) {
return (blendHardMix(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendHardMix)
#olive name Hard Mix
-14
View File
@@ -1,14 +0,0 @@
float blendLighten(float base, float blend) {
return max(blend,base);
}
vec3 blendLighten(vec3 base, vec3 blend) {
return vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));
}
vec3 blendLighten(vec3 base, vec3 blend, float opacity) {
return (blendLighten(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendLighten)
#olive name Lighten
-16
View File
@@ -1,16 +0,0 @@
float blendLinearBurn(float base, float blend) {
// Note : Same implementation as BlendSubtractf
return max(base+blend-1.0,0.0);
}
vec3 blendLinearBurn(vec3 base, vec3 blend) {
// Note : Same implementation as BlendSubtract
return max(base+blend-vec3(1.0),vec3(0.0));
}
vec3 blendLinearBurn(vec3 base, vec3 blend, float opacity) {
return (blendLinearBurn(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendLinearBurn)
#olive name Linear Burn
-16
View File
@@ -1,16 +0,0 @@
float blendLinearDodge(float base, float blend) {
// Note : Same implementation as BlendAddf
return min(base+blend,1.0);
}
vec3 blendLinearDodge(vec3 base, vec3 blend) {
// Note : Same implementation as BlendAdd
return min(base+blend,vec3(1.0));
}
vec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {
return (blendLinearDodge(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendLinearDodge)
#olive name Linear Dodge
-17
View File
@@ -1,17 +0,0 @@
#pragma glslify: blendLinearDodge = require(./linear-dodge)
#pragma glslify: blendLinearBurn = require(./linear-burn)
float blendLinearLight(float base, float blend) {
return blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));
}
vec3 blendLinearLight(vec3 base, vec3 blend) {
return vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));
}
vec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {
return (blendLinearLight(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendLinearLight)
#olive name Linear Light
-10
View File
@@ -1,10 +0,0 @@
vec3 blendMultiply(vec3 base, vec3 blend) {
return base*blend;
}
vec3 blendMultiply(vec3 base, vec3 blend, float opacity) {
return (blendMultiply(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendMultiply)
#olive name Multiply
-10
View File
@@ -1,10 +0,0 @@
vec3 blendNegation(vec3 base, vec3 blend) {
return vec3(1.0)-abs(vec3(1.0)-base-blend);
}
vec3 blendNegation(vec3 base, vec3 blend, float opacity) {
return (blendNegation(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendNegation)
#olive name Negation
-10
View File
@@ -1,10 +0,0 @@
vec3 blendNormal(vec3 base, vec3 blend) {
return blend;
}
vec3 blendNormal(vec3 base, vec3 blend, float opacity) {
return (blendNormal(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendNormal)
#olive name Normal
-14
View File
@@ -1,14 +0,0 @@
float blendOverlay(float base, float blend) {
return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));
}
vec3 blendOverlay(vec3 base, vec3 blend) {
return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));
}
vec3 blendOverlay(vec3 base, vec3 blend, float opacity) {
return (blendOverlay(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendOverlay)
#olive name Overlay
-10
View File
@@ -1,10 +0,0 @@
vec3 blendPhoenix(vec3 base, vec3 blend) {
return min(base,blend)-max(base,blend)+vec3(1.0);
}
vec3 blendPhoenix(vec3 base, vec3 blend, float opacity) {
return (blendPhoenix(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendPhoenix)
#olive name Phoenix
-17
View File
@@ -1,17 +0,0 @@
#pragma glslify: blendLighten = require(./lighten)
#pragma glslify: blendDarken = require(./darken)
float blendPinLight(float base, float blend) {
return (blend<0.5)?blendDarken(base,(2.0*blend)):blendLighten(base,(2.0*(blend-0.5)));
}
vec3 blendPinLight(vec3 base, vec3 blend) {
return vec3(blendPinLight(base.r,blend.r),blendPinLight(base.g,blend.g),blendPinLight(base.b,blend.b));
}
vec3 blendPinLight(vec3 base, vec3 blend, float opacity) {
return (blendPinLight(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendPinLight)
#olive name Pin Light
-14
View File
@@ -1,14 +0,0 @@
float blendReflect(float base, float blend) {
return (blend==1.0)?blend:min(base*base/(1.0-blend),1.0);
}
vec3 blendReflect(vec3 base, vec3 blend) {
return vec3(blendReflect(base.r,blend.r),blendReflect(base.g,blend.g),blendReflect(base.b,blend.b));
}
vec3 blendReflect(vec3 base, vec3 blend, float opacity) {
return (blendReflect(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendReflect)
#olive name Reflect
-14
View File
@@ -1,14 +0,0 @@
float blendScreen(float base, float blend) {
return 1.0-((1.0-base)*(1.0-blend));
}
vec3 blendScreen(vec3 base, vec3 blend) {
return vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));
}
vec3 blendScreen(vec3 base, vec3 blend, float opacity) {
return (blendScreen(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendScreen)
#olive name Screen
-14
View File
@@ -1,14 +0,0 @@
float blendSoftLight(float base, float blend) {
return (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));
}
vec3 blendSoftLight(vec3 base, vec3 blend) {
return vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));
}
vec3 blendSoftLight(vec3 base, vec3 blend, float opacity) {
return (blendSoftLight(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendSoftLight)
#olive name Soft Light
-14
View File
@@ -1,14 +0,0 @@
float blendSubstract(float base, float blend) {
return max(base+blend-1.0,0.0);
}
vec3 blendSubstract(vec3 base, vec3 blend) {
return max(base+blend-vec3(1.0),vec3(0.0));
}
vec3 blendSubstract(vec3 base, vec3 blend, float opacity) {
return (blendSubstract(base, blend) * opacity + blend * (1.0 - opacity));
}
#pragma glslify: export(blendSubstract)
#olive name Substract
-14
View File
@@ -1,14 +0,0 @@
float blendSubtract(float base, float blend) {
return max(base+blend-1.0,0.0);
}
vec3 blendSubtract(vec3 base, vec3 blend) {
return max(base+blend-vec3(1.0),vec3(0.0));
}
vec3 blendSubtract(vec3 base, vec3 blend, float opacity) {
return (blendSubtract(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendSubtract)
#olive name Subtract
-17
View File
@@ -1,17 +0,0 @@
#pragma glslify: blendColorDodge = require(./color-dodge)
#pragma glslify: blendColorBurn = require(./color-burn)
float blendVividLight(float base, float blend) {
return (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));
}
vec3 blendVividLight(vec3 base, vec3 blend) {
return vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));
}
vec3 blendVividLight(vec3 base, vec3 blend, float opacity) {
return (blendVividLight(base, blend) * opacity + base * (1.0 - opacity));
}
#pragma glslify: export(blendVividLight)
#olive name Vivid Light