[orx-temporal-blur] allow 0 jitter and fix small bug (#164)
This commit is contained in:
committed by
GitHub
parent
b58870bee9
commit
10099c7d9a
@@ -172,8 +172,10 @@ class TemporalBlur : Extension {
|
|||||||
drawer.drawStyle.blendMode = BlendMode.OVER
|
drawer.drawStyle.blendMode = BlendMode.OVER
|
||||||
drawer.drawStyle.colorMatrix = Matrix55.IDENTITY
|
drawer.drawStyle.colorMatrix = Matrix55.IDENTITY
|
||||||
drawer.isolated {
|
drawer.isolated {
|
||||||
|
if (jitter > 0.0){
|
||||||
val offset = Vector2.uniformRing(0.0, jitter)
|
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
|
drawer.projection = Matrix44.translate(offset.x * (1.0 / program.width), offset.y * (1.0 / program.height), 0.0) * drawer.projection
|
||||||
|
}
|
||||||
|
|
||||||
for (extension in extensionTail) {
|
for (extension in extensionTail) {
|
||||||
extension.beforeDraw(drawer, program)
|
extension.beforeDraw(drawer, program)
|
||||||
@@ -194,6 +196,7 @@ class TemporalBlur : Extension {
|
|||||||
|
|
||||||
add.apply(arrayOf(imageResolved!!.colorBuffer(0), accumulator!!.colorBuffer(0)), accumulator!!.colorBuffer(0))
|
add.apply(arrayOf(imageResolved!!.colorBuffer(0), accumulator!!.colorBuffer(0)), accumulator!!.colorBuffer(0))
|
||||||
program.clock = oldClock
|
program.clock = oldClock
|
||||||
|
fsf.setDouble(program, program.clock())
|
||||||
}
|
}
|
||||||
image?.let {
|
image?.let {
|
||||||
drawer.withTarget(it) {
|
drawer.withTarget(it) {
|
||||||
|
|||||||
Reference in New Issue
Block a user