Add configurable color type for Layer
This commit is contained in:
@@ -31,6 +31,7 @@ open class Layer internal constructor() {
|
|||||||
val children: MutableList<Layer> = mutableListOf()
|
val children: MutableList<Layer> = mutableListOf()
|
||||||
var blendFilter: Pair<Filter, Filter.() -> Unit>? = null
|
var blendFilter: Pair<Filter, Filter.() -> Unit>? = null
|
||||||
val postFilters: MutableList<Pair<Filter, Filter.() -> Unit>> = mutableListOf()
|
val postFilters: MutableList<Pair<Filter, Filter.() -> Unit>> = mutableListOf()
|
||||||
|
var colorType = ColorType.UINT8
|
||||||
|
|
||||||
@BooleanParameter("enabled")
|
@BooleanParameter("enabled")
|
||||||
var enabled = true
|
var enabled = true
|
||||||
@@ -52,7 +53,7 @@ open class Layer internal constructor() {
|
|||||||
if (localLayerTarget == null || (localLayerTarget.width != activeRenderTarget.width || localLayerTarget.height != activeRenderTarget.height)) {
|
if (localLayerTarget == null || (localLayerTarget.width != activeRenderTarget.width || localLayerTarget.height != activeRenderTarget.height)) {
|
||||||
layerTarget?.deepDestroy()
|
layerTarget?.deepDestroy()
|
||||||
layerTarget = renderTarget(activeRenderTarget.width, activeRenderTarget.height) {
|
layerTarget = renderTarget(activeRenderTarget.width, activeRenderTarget.height) {
|
||||||
colorBuffer()
|
colorBuffer(type = colorType)
|
||||||
depthBuffer()
|
depthBuffer()
|
||||||
}
|
}
|
||||||
layerTarget?.let {
|
layerTarget?.let {
|
||||||
@@ -86,12 +87,8 @@ open class Layer internal constructor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (postBufferCache.isEmpty()) {
|
if (postBufferCache.isEmpty()) {
|
||||||
postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height).apply {
|
postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height, type = colorType)
|
||||||
Session.active.untrack(this)
|
postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height, type = colorType)
|
||||||
}
|
|
||||||
postBufferCache += colorBuffer(activeRenderTarget.width, activeRenderTarget.height).apply {
|
|
||||||
Session.active.untrack(this)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user