Add orx-dnk3a

This commit is contained in:
Edwin Jakobs
2020-05-21 10:42:02 +02:00
parent 0a1fd58012
commit e478ae5969
31 changed files with 2672 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
package org.openrndr.extra.dnk3
import org.openrndr.draw.BufferMultisample
import org.openrndr.draw.DepthFormat
import org.openrndr.draw.RenderTarget
import org.openrndr.draw.renderTarget
class RenderPass(val combiners: List<FacetCombiner>, val renderOpaque: Boolean = true, val renderTransparent: Boolean = false)
val DefaultPass = RenderPass(listOf(LDRColorFacet()))
val LightPass = RenderPass(emptyList())
val VSMLightPass = RenderPass(listOf(MomentsFacet()))
fun RenderPass.createPassTarget(width: Int, height: Int, depthFormat: DepthFormat = DepthFormat.DEPTH24, multisample: BufferMultisample = BufferMultisample.Disabled): RenderTarget {
return renderTarget(width, height, multisample = multisample) {
for (combiner in combiners) {
when (combiner) {
is ColorBufferFacetCombiner ->
colorBuffer(combiner.targetOutput, combiner.format, combiner.type)
}
}
depthBuffer(depthFormat)
}
}