Fix ShapeSDF in case no distortion map is given

This commit is contained in:
Edwin Jakobs
2020-04-28 16:36:38 +02:00
parent 0cbd504d3a
commit 69a0b0c0ce
2 changed files with 7 additions and 6 deletions

View File

@@ -39,7 +39,6 @@ fun main() {
} }
} }
extend { extend {
drawer.background(ColorRGBa.PINK) drawer.background(ColorRGBa.PINK)
fd.apply(emptyArray(), uvmap) fd.apply(emptyArray(), uvmap)

View File

@@ -73,6 +73,8 @@ class ShapeSDF : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/shape-sdf.
parameters["fromBuffer"] = fromBuffer parameters["fromBuffer"] = fromBuffer
parameters["toBuffer"] = toBuffer parameters["toBuffer"] = toBuffer
parameters["segmentCount"] = segmentCount parameters["segmentCount"] = segmentCount
super.apply(source, target) // -- bit of an hack
val effectiveSource = if (source.isNotEmpty()) source else target
super.apply(effectiveSource, target)
} }
} }