Add SDFBlend filter to orx-jumpflood

This commit is contained in:
Edwin Jakobs
2020-04-28 18:35:41 +02:00
parent febf1070bc
commit bfe35c1d1a
2 changed files with 31 additions and 0 deletions

View File

@@ -84,3 +84,19 @@ class SDFOnion : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/ops/sdf-on
super.apply(source, target)
}
}
class SDFBlend : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/ops/sdf-blend.frag"))) {
var factor: Double by parameters
init {
factor = 0.5
}
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
require(target[0].type == ColorType.FLOAT16 || target[0].type == ColorType.FLOAT32) {
"needs a floating point target"
}
super.apply(source, target)
}
}