Added Matt DesLauriers' crosshatch shader as a Filter...
It's also using Hugh Kennedy's glsl-luma, which is a dependency of glsl-crosshatch-filter.
This commit is contained in:
30
orx-fx/src/main/kotlin/dither/Crosshatch.kt
Normal file
30
orx-fx/src/main/kotlin/dither/Crosshatch.kt
Normal file
@@ -0,0 +1,30 @@
|
||||
package org.openrndr.extra.fx.dither
|
||||
|
||||
import org.openrndr.draw.Filter
|
||||
import org.openrndr.draw.Shader
|
||||
import org.openrndr.extra.fx.filterFragmentCode
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.DoubleParameter
|
||||
|
||||
|
||||
@Description("Crosshatch")
|
||||
class Crosshatch: Filter(Shader.createFromCode(filterVertexCode, filterFragmentCode("dither/crosshatch.frag"))) {
|
||||
@DoubleParameter("threshold 1", 0.0, 1.0)
|
||||
var t1: Double by parameters
|
||||
|
||||
@DoubleParameter("threshold 2", 0.0, 1.0)
|
||||
var t2: Double by parameters
|
||||
|
||||
@DoubleParameter("threshold 3", 0.0, 1.0)
|
||||
var t3: Double by parameters
|
||||
|
||||
@DoubleParameter("threshold 4", 0.0, 1.0)
|
||||
var t4: Double by parameters
|
||||
|
||||
init {
|
||||
t1 = 1.0
|
||||
t2 = 0.75
|
||||
t3 = 0.5
|
||||
t4 = 0.3
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user