diff --git a/orx-compositor/src/main/kotlin/Compositor.kt b/orx-compositor/src/main/kotlin/Compositor.kt index 25b10a47..35940b9a 100644 --- a/orx-compositor/src/main/kotlin/Compositor.kt +++ b/orx-compositor/src/main/kotlin/Compositor.kt @@ -31,6 +31,7 @@ open class Layer internal constructor() { val children: MutableList = mutableListOf() var blendFilter: Pair Unit>? = null val postFilters: MutableList Unit>> = mutableListOf() + var colorType = ColorType.UINT8 @BooleanParameter("enabled") var enabled = true @@ -52,7 +53,7 @@ open class Layer internal constructor() { if (localLayerTarget == null || (localLayerTarget.width != activeRenderTarget.width || localLayerTarget.height != activeRenderTarget.height)) { layerTarget?.deepDestroy() layerTarget = renderTarget(activeRenderTarget.width, activeRenderTarget.height) { - colorBuffer() + colorBuffer(type = colorType) depthBuffer() } layerTarget?.let { @@ -86,12 +87,8 @@ open class Layer internal constructor() { } if (postBufferCache.isEmpty()) { - postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height).apply { - Session.active.untrack(this) - } - postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height).apply { - Session.active.untrack(this) - } + postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height, type = colorType) + postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height, type = colorType) } }