Bump to OPENRNDR 0.3.43-rc.14
This commit is contained in:
@@ -14,7 +14,7 @@ buildscript {
|
||||
apply plugin: 'org.jetbrains.dokka'
|
||||
|
||||
project.ext {
|
||||
openrndrVersion = "0.3.43-rc.13"
|
||||
openrndrVersion = "0.3.43-rc.14"
|
||||
kotlinVersion = "1.3.72"
|
||||
spekVersion = "2.0.10"
|
||||
libfreenectVersion = "0.5.7-1.5.3"
|
||||
|
||||
@@ -13,12 +13,17 @@ import org.openrndr.math.Matrix44
|
||||
private val postBufferCache = mutableListOf<ColorBuffer>()
|
||||
|
||||
fun RenderTarget.deepDestroy() {
|
||||
val cbcopy = colorBuffers.map { it }
|
||||
val cbcopy = colorAttachments.map { it }
|
||||
val dbcopy = depthBuffer
|
||||
detachDepthBuffer()
|
||||
detachColorBuffers()
|
||||
detachColorAttachments()
|
||||
cbcopy.forEach {
|
||||
it.destroy()
|
||||
when (it) {
|
||||
is ColorBufferAttachment -> it.colorBuffer.destroy()
|
||||
is CubemapAttachment -> it.cubemap.destroy()
|
||||
is ArrayTextureAttachment -> it.arrayTexture.destroy()
|
||||
is ArrayCubemapAttachment -> it.arrayCubemap.destroy()
|
||||
}
|
||||
}
|
||||
dbcopy?.destroy()
|
||||
destroy()
|
||||
@@ -42,15 +47,16 @@ open class Layer internal constructor() {
|
||||
|
||||
@BooleanParameter("enabled")
|
||||
var enabled = true
|
||||
|
||||
@BooleanParameter("Invert mask")
|
||||
var invertMask = false
|
||||
var clearColor: ColorRGBa? = ColorRGBa.TRANSPARENT
|
||||
private var layerTarget: RenderTarget? = null
|
||||
|
||||
val result: ColorBuffer?
|
||||
get() {
|
||||
return layerTarget?.colorBuffer(0)
|
||||
}
|
||||
get() {
|
||||
return layerTarget?.colorBuffer(0)
|
||||
}
|
||||
|
||||
/**
|
||||
* draw the layer
|
||||
@@ -65,7 +71,7 @@ open class Layer internal constructor() {
|
||||
accumulation = if (activeRenderTarget !is ProgramRenderTarget) {
|
||||
activeRenderTarget.colorBuffer(0)
|
||||
} else {
|
||||
null
|
||||
null
|
||||
}
|
||||
|
||||
if (shouldCreateLayerTarget(activeRenderTarget)) {
|
||||
@@ -238,8 +244,8 @@ fun <F : Filter> Layer.blend(filter: F, configure: F.() -> Unit = {}): F {
|
||||
return filter
|
||||
}
|
||||
|
||||
class Composite: Layer() {
|
||||
fun draw(drawer:Drawer) {
|
||||
class Composite : Layer() {
|
||||
fun draw(drawer: Drawer) {
|
||||
drawLayer(drawer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ class PBRMaterial : Material {
|
||||
if (rt is ProgramRenderTarget || materialContext.pass === DefaultPass || materialContext.pass === DefaultOpaquePass || materialContext.pass == DefaultTransparentPass) {
|
||||
this.output(it.targetOutput, ShadeStyleOutput(0))
|
||||
} else {
|
||||
val index = rt.colorBufferIndex(it.targetOutput)
|
||||
val index = rt.colorAttachmentIndexByName(it.targetOutput) ?: error("no such attachment ${it.targetOutput}")
|
||||
val type = rt.colorBuffer(index).type
|
||||
val format = rt.colorBuffer(0).format
|
||||
this.output(it.targetOutput, ShadeStyleOutput(index, format, type))
|
||||
@@ -521,7 +521,7 @@ class PBRMaterial : Material {
|
||||
|
||||
is SpotLight -> {
|
||||
shadeStyle.parameter("lightPosition$index", (node.worldTransform * Vector4.UNIT_W).xyz)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction).normalized)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction.xyz0).normalized.xyz)
|
||||
shadeStyle.parameter("lightConstantAttenuation$index", light.constantAttenuation)
|
||||
shadeStyle.parameter("lightLinearAttenuation$index", light.linearAttenuation)
|
||||
shadeStyle.parameter("lightQuadraticAttenuation$index", light.quadraticAttenuation)
|
||||
@@ -546,7 +546,7 @@ class PBRMaterial : Material {
|
||||
}
|
||||
is DirectionalLight -> {
|
||||
shadeStyle.parameter("lightPosition$index", (node.worldTransform * Vector4.UNIT_W).xyz)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction).normalized)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction.xyz0).normalized.xyz)
|
||||
if (light.shadows is Shadows.MappedShadows) {
|
||||
context.shadowMaps[light]?.let {
|
||||
val look = light.view(node)
|
||||
@@ -565,7 +565,7 @@ class PBRMaterial : Material {
|
||||
}
|
||||
|
||||
is HemisphereLight -> {
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction).normalized)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction.xyz0).normalized.xyz)
|
||||
shadeStyle.parameter("lightUpColor$index", light.upColor)
|
||||
shadeStyle.parameter("lightDownColor$index", light.downColor)
|
||||
|
||||
|
||||
@@ -117,7 +117,8 @@ class SceneRenderer {
|
||||
outputPassTarget?.let { target ->
|
||||
pass.combiners.forEach {
|
||||
if (it is ColorBufferFacetCombiner) {
|
||||
val index = target.colorBufferIndex(it.targetOutput)
|
||||
val index = target.colorAttachmentIndexByName(it.targetOutput)
|
||||
?: error("no such attachment ${it.targetOutput}")
|
||||
target.blendMode(index, it.blendMode)
|
||||
}
|
||||
}
|
||||
@@ -128,7 +129,8 @@ class SceneRenderer {
|
||||
|
||||
outputPassTarget?.let { output ->
|
||||
for (combiner in pass.combiners) {
|
||||
buffers[combiner.targetOutput] = output.colorBuffer(combiner.targetOutput)
|
||||
buffers[combiner.targetOutput] = (output.colorAttachmentByName(combiner.targetOutput) as? ColorBufferAttachment)?.colorBuffer
|
||||
?: error("no such attachment: ${combiner.targetOutput}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,9 +228,8 @@ class SceneRenderer {
|
||||
val nodeInverse = it.node.worldTransform.inversed
|
||||
|
||||
|
||||
|
||||
val jointTransforms = (skinnedMesh.joints zip skinnedMesh.inverseBindMatrices)
|
||||
.map{ (nodeInverse * it.first.worldTransform * it.second) }
|
||||
.map { (nodeInverse * it.first.worldTransform * it.second) }
|
||||
// val jointNormalTransforms = jointTransforms.map { Matrix44.IDENTITY }
|
||||
|
||||
val shadeStyle = primitive.material.generateShadeStyle(materialContext, primitiveContext)
|
||||
@@ -269,7 +270,7 @@ class SceneRenderer {
|
||||
.forEach {
|
||||
val primitive = it.content
|
||||
drawer.isolated {
|
||||
val primitiveContext = PrimitiveContext(true, false)
|
||||
val primitiveContext = PrimitiveContext(true, false)
|
||||
val shadeStyle = primitive.primitive.material.generateShadeStyle(materialContext, primitiveContext)
|
||||
shadeStyle.parameter("viewMatrixInverse", drawer.view.inversed)
|
||||
primitive.primitive.material.applyToShadeStyle(materialContext, shadeStyle)
|
||||
|
||||
@@ -363,10 +363,10 @@ class ControlManager : Extension {
|
||||
|
||||
body?.draw?.dirty = true
|
||||
|
||||
if (renderTarget.colorBuffers.isNotEmpty()) {
|
||||
if (renderTarget.colorAttachments.isNotEmpty()) {
|
||||
renderTarget.colorBuffer(0).destroy()
|
||||
renderTarget.depthBuffer?.destroy()
|
||||
renderTarget.detachColorBuffers()
|
||||
renderTarget.detachColorAttachments()
|
||||
renderTarget.detachDepthBuffer()
|
||||
renderTarget.destroy()
|
||||
} else {
|
||||
|
||||
@@ -124,11 +124,16 @@ internal class ConvolutionPyramid(width: Int, height: Int,
|
||||
fun destroy() {
|
||||
result.destroy()
|
||||
(levelsIn+levelsOut).forEach {
|
||||
it.colorBuffers.forEach { it.destroy() }
|
||||
it.detachColorBuffers()
|
||||
it.colorAttachments.forEach {
|
||||
when(it) {
|
||||
is ColorBufferAttachment -> it.colorBuffer.destroy()
|
||||
is CubemapAttachment -> it.cubemap.destroy()
|
||||
is ArrayTextureAttachment -> it.arrayTexture.destroy()
|
||||
is ArrayCubemapAttachment -> it.arrayCubemap.destroy()
|
||||
}
|
||||
}
|
||||
it.detachColorAttachments()
|
||||
it.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class TemporalBlur : Extension {
|
||||
accumulator?.let { a ->
|
||||
if (a.width != program.width || a.height != program.height) {
|
||||
a.colorBuffer(0).destroy()
|
||||
a.detachColorBuffers()
|
||||
a.detachColorAttachments()
|
||||
a.destroy()
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ class TemporalBlur : Extension {
|
||||
result?.let { r ->
|
||||
if (r.width != program.width || r.height != program.height) {
|
||||
r.colorBuffer(0).destroy()
|
||||
r.detachColorBuffers()
|
||||
r.detachColorAttachments()
|
||||
r.destroy()
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class TemporalBlur : Extension {
|
||||
if (i.width != program.width || i.height != program.height) {
|
||||
i.colorBuffer(0).destroy()
|
||||
i.depthBuffer?.destroy()
|
||||
i.detachColorBuffers()
|
||||
i.detachColorAttachments()
|
||||
i.detachDepthBuffer()
|
||||
i.destroy()
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class TemporalBlur : Extension {
|
||||
imageResolved?.let { i ->
|
||||
if (i.width != program.width || i.height != program.height) {
|
||||
i.colorBuffer(0).destroy()
|
||||
i.detachColorBuffers()
|
||||
i.detachColorAttachments()
|
||||
i.destroy()
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ class TemporalBlur : Extension {
|
||||
|
||||
if (linearizeInput) {
|
||||
imageResolved?.let {
|
||||
linearize.apply(it, it)
|
||||
linearize.apply(it.colorBuffer(0), it.colorBuffer(0))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user