[orx-fx] Fix problems with content scales in ApproximateGaussianBlur
This commit is contained in:
@@ -57,23 +57,21 @@ open class MipBloom<T:Filter>(val blur:T) : Filter(filterShaderFromUrl(filterFra
|
||||
val combine = BloomCombine()
|
||||
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
|
||||
sourceCopy?.let {
|
||||
if (it.width != source[0].width || it.height != source[0].height) {
|
||||
if (!it.isEquivalentTo(source[0], ignoreType = true)) {
|
||||
it.destroy()
|
||||
sourceCopy = null
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceCopy == null) {
|
||||
sourceCopy = colorBuffer(source[0].width, source[0].height, type = ColorType.FLOAT16)
|
||||
sourceCopy = source[0].createEquivalent(type = ColorType.FLOAT16)
|
||||
}
|
||||
|
||||
source[0].copyTo(sourceCopy!!)
|
||||
|
||||
upscale.shape = shape
|
||||
if (intermediates.size != passes
|
||||
|| (intermediates.isNotEmpty() && (intermediates[0].width!=target[0].width || intermediates[0].height != target[0].height) )) {
|
||||
|| (intermediates.isNotEmpty() && (!intermediates[0].isEquivalentTo(target[0], ignoreType = true, ignoreFormat = true)))) {
|
||||
intermediates.forEach {
|
||||
it.destroy()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user