[orx-fx] Use the appropriate FilterNto1 interfaces

* Fix webgl 2 compatibility
 * Add LumaLaplacian, ACESTonemap, ReinhardTonemap, DirectionalHashBlur
This commit is contained in:
Edwin Jakobs
2022-12-28 13:57:27 +01:00
parent beb53bbde7
commit 750b5ef67e
87 changed files with 578 additions and 175 deletions

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.edges
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_canny_edge_detector
import org.openrndr.extra.parameters.ColorParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Canny Edge Detector")
class CannyEdgeDetector : Filter(
class CannyEdgeDetector : Filter1to1(
filterShaderFromCode(fx_canny_edge_detector, "canny-edge-detector")
) {

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.edges
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_contour
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
@@ -10,7 +11,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Contour")
class Contour : Filter(mppFilterShader(fx_contour, "contour")) {
class Contour : Filter1to1(mppFilterShader(fx_contour, "contour")) {
@DoubleParameter("levels", 1.0, 16.0)
var levels: Double by parameters

View File

@@ -18,7 +18,7 @@ internal class EdgesWork1 : Filter(mppFilterShader(fx_edges_work_1, "edges-work-
}
@Description("Edges Work")
open class EdgesWork : Filter(mppFilterShader(fx_edges_work_2, "edges-work-2")) {
open class EdgesWork : Filter1to1(mppFilterShader(fx_edges_work_2, "edges-work-2")) {
/**
* radius, default value is 1.0
*/

View File

@@ -0,0 +1,31 @@
package org.openrndr.extra.fx.edges
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_luma_laplacian
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma Sobel")
class LumaLaplacian : Filter1to1(mppFilterShader(fx_luma_laplacian, "luma-laplacian")) {
@ColorParameter("background color")
var backgroundColor: ColorRGBa by parameters
@ColorParameter("edge color")
var edgeColor: ColorRGBa by parameters
@DoubleParameter("background opacity", 0.0, 1.0)
var backgroundOpacity: Double by parameters
@DoubleParameter("edge opacity", 0.0, 1.0)
var edgeOpacity: Double by parameters
init {
backgroundColor = ColorRGBa.BLACK
edgeColor = ColorRGBa.WHITE
edgeOpacity = 1.0
backgroundOpacity = 1.0
}
}

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.edges
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_luma_sobel
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma Sobel")
class LumaSobel : Filter(mppFilterShader(fx_luma_sobel, "luma-sobel")) {
class LumaSobel : Filter1to1(mppFilterShader(fx_luma_sobel, "luma-sobel")) {
@ColorParameter("background color")
var backgroundColor: ColorRGBa by parameters