From b6c16f08311f0262cce8dc941175eda223f0fe0f Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Thu, 27 Feb 2020 22:30:46 +0100 Subject: [PATCH] Add access to accumulation buffer in orx-compositor --- orx-compositor/src/main/kotlin/Compositor.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/orx-compositor/src/main/kotlin/Compositor.kt b/orx-compositor/src/main/kotlin/Compositor.kt index 35940b9a..555f384b 100644 --- a/orx-compositor/src/main/kotlin/Compositor.kt +++ b/orx-compositor/src/main/kotlin/Compositor.kt @@ -32,6 +32,7 @@ open class Layer internal constructor() { var blendFilter: Pair Unit>? = null val postFilters: MutableList Unit>> = mutableListOf() var colorType = ColorType.UINT8 + var accumulation: ColorBuffer? = null @BooleanParameter("enabled") var enabled = true @@ -48,6 +49,11 @@ open class Layer internal constructor() { val activeRenderTarget = RenderTarget.active + accumulation = if (activeRenderTarget !is ProgramRenderTarget) { + activeRenderTarget.colorBuffer(0) + } else { + null + } val localLayerTarget = layerTarget if (localLayerTarget == null || (localLayerTarget.width != activeRenderTarget.width || localLayerTarget.height != activeRenderTarget.height)) {