[orx-integral-image, orx-poisson-fill, orx-dnk3] Match changes in Filter
This commit is contained in:
@@ -5,6 +5,7 @@ import org.openrndr.extra.fx.blend.Passthrough
|
||||
|
||||
import org.openrndr.math.Vector2
|
||||
import org.openrndr.resourceUrl
|
||||
import org.openrndr.shape.Rectangle
|
||||
|
||||
|
||||
class FastIntegralImageFilter : Filter(filterShaderFromUrl(resourceUrl(
|
||||
@@ -38,8 +39,8 @@ class FastIntegralImage : Filter(filterShaderFromUrl(resourceUrl(
|
||||
return sampleCounts
|
||||
}
|
||||
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>, clip: Rectangle?) {
|
||||
require(clip == null)
|
||||
val sampleCountBase = 16
|
||||
val xSampleCounts = sampleCounts(source[0].width, sampleCountBase)
|
||||
val ySampleCounts = sampleCounts(source[0].height, sampleCountBase)
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.openrndr.extra.shaderphrases.preprocessShader
|
||||
import org.openrndr.math.IntVector3
|
||||
import org.openrndr.math.Matrix44
|
||||
import org.openrndr.resourceUrl
|
||||
import org.openrndr.shape.Rectangle
|
||||
import java.net.URL
|
||||
|
||||
fun preprocessedFilterShaderFromUrl(url: String): Shader {
|
||||
@@ -30,7 +31,8 @@ class VolumetricIrradiance : Filter(preprocessedFilterShaderFromUrl(resourceUrl(
|
||||
projectionMatrixInverse = Matrix44.IDENTITY
|
||||
}
|
||||
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>, clip: Rectangle?) {
|
||||
require(clip == null)
|
||||
irradianceSH?.shMap?.let {
|
||||
parameters["shMap"] = it
|
||||
}
|
||||
@@ -39,7 +41,7 @@ class VolumetricIrradiance : Filter(preprocessedFilterShaderFromUrl(resourceUrl(
|
||||
parameters["shMapOffset"] = it.offset
|
||||
parameters["shMapSpacing"] = it.spacing
|
||||
}
|
||||
super.apply(source, target)
|
||||
super.apply(source, target, clip)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.openrndr.extra.fx.blend.Subtract
|
||||
import org.openrndr.filter.color.delinearize
|
||||
import org.openrndr.filter.color.linearize
|
||||
import org.openrndr.resourceUrl
|
||||
import org.openrndr.shape.Rectangle
|
||||
|
||||
internal class BlendBoundary : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/blend-boundary.frag")))
|
||||
class AlphaToBitmap : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/alpha-to-bitmap.frag")))
|
||||
@@ -71,7 +72,8 @@ class PoissonBlend: Filter2to1() {
|
||||
val alphaToBitmap = AlphaToBitmap()
|
||||
var mask: ColorBuffer? = null
|
||||
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>, clip: Rectangle?) {
|
||||
require(clip == null)
|
||||
if (target.isNotEmpty()) {
|
||||
|
||||
mask?.let {
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.openrndr.poissonfill
|
||||
|
||||
import org.openrndr.draw.*
|
||||
import org.openrndr.resourceUrl
|
||||
import org.openrndr.shape.Rectangle
|
||||
|
||||
internal class FillBoundary : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/fill-boundary.frag")))
|
||||
internal class FillCombine : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/fill-combine.frag")))
|
||||
@@ -41,7 +42,8 @@ class PoissonFiller(val width: Int, val height: Int, type: ColorType = ColorType
|
||||
*/
|
||||
class PoissonFill : Filter1to1() {
|
||||
private var filler: PoissonFiller? = null
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>, clip: Rectangle?) {
|
||||
require(clip == null)
|
||||
if (target.isNotEmpty()) {
|
||||
filler?.let {
|
||||
if (it.width != target[0].effectiveWidth || it.height != target[0].effectiveHeight) {
|
||||
|
||||
Reference in New Issue
Block a user