Skip to content

Commit

Permalink
Add access to accumulation buffer in orx-compositor
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Feb 27, 2020
1 parent 5b23e18 commit b6c16f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions orx-compositor/src/main/kotlin/Compositor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ open class Layer internal constructor() {
var blendFilter: Pair<Filter, Filter.() -> Unit>? = null
val postFilters: MutableList<Pair<Filter, Filter.() -> Unit>> = mutableListOf()
var colorType = ColorType.UINT8
var accumulation: ColorBuffer? = null

@BooleanParameter("enabled")
var enabled = true
Expand All @@ -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)) {
Expand Down

0 comments on commit b6c16f0

Please sign in to comment.