From 10099c7d9a32c916e6fa192f0349c4a2f7797bcc Mon Sep 17 00:00:00 2001 From: Steven van den Broek <30909373+Yvee1@users.noreply.github.com> Date: Sat, 30 Jan 2021 21:13:20 +0100 Subject: [PATCH] [orx-temporal-blur] allow 0 jitter and fix small bug (#164) --- orx-temporal-blur/src/main/kotlin/TemporalBlur.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt b/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt index f74c81f0..175ddda4 100644 --- a/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt +++ b/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt @@ -172,8 +172,10 @@ class TemporalBlur : Extension { drawer.drawStyle.blendMode = BlendMode.OVER drawer.drawStyle.colorMatrix = Matrix55.IDENTITY drawer.isolated { - val offset = Vector2.uniformRing(0.0, jitter) - drawer.projection = Matrix44.translate(offset.x * (1.0 / program.width), offset.y * (1.0 / program.height), 0.0) * drawer.projection + if (jitter > 0.0){ + val offset = Vector2.uniformRing(0.0, jitter) + drawer.projection = Matrix44.translate(offset.x * (1.0 / program.width), offset.y * (1.0 / program.height), 0.0) * drawer.projection + } for (extension in extensionTail) { extension.beforeDraw(drawer, program) @@ -194,6 +196,7 @@ class TemporalBlur : Extension { add.apply(arrayOf(imageResolved!!.colorBuffer(0), accumulator!!.colorBuffer(0)), accumulator!!.colorBuffer(0)) program.clock = oldClock + fsf.setDouble(program, program.clock()) } image?.let { drawer.withTarget(it) {