Merge branch 'master' of github.com:openrndr/orx
This commit is contained in:
@@ -50,6 +50,11 @@ Supported Gltf features
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### DemoScene03
|
||||||
|
[source code](src/demo/kotlin/DemoScene03.kt)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### DemoSkinning01
|
### DemoSkinning01
|
||||||
[source code](src/demo/kotlin/DemoSkinning01.kt)
|
[source code](src/demo/kotlin/DemoSkinning01.kt)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.color
|
|||||||
|
|
||||||
import org.openrndr.draw.*
|
import org.openrndr.draw.*
|
||||||
import org.openrndr.extra.fx.filterFragmentUrl
|
import org.openrndr.extra.fx.filterFragmentUrl
|
||||||
|
import org.openrndr.extra.parameters.BooleanParameter
|
||||||
import org.openrndr.extra.parameters.Description
|
import org.openrndr.extra.parameters.Description
|
||||||
import org.openrndr.extra.parameters.DoubleParameter
|
import org.openrndr.extra.parameters.DoubleParameter
|
||||||
|
|
||||||
@@ -25,6 +26,9 @@ class ColorCorrection : Filter(filterShaderFromUrl(filterFragmentUrl("color/colo
|
|||||||
@DoubleParameter("opacity", 0.0, 1.0, order = 5)
|
@DoubleParameter("opacity", 0.0, 1.0, order = 5)
|
||||||
var opacity: Double by parameters
|
var opacity: Double by parameters
|
||||||
|
|
||||||
|
@BooleanParameter("clamp", order = 6)
|
||||||
|
var clamped: Boolean by parameters
|
||||||
|
|
||||||
init {
|
init {
|
||||||
contrast = 0.0
|
contrast = 0.0
|
||||||
brightness = 0.0
|
brightness = 0.0
|
||||||
@@ -32,5 +36,6 @@ class ColorCorrection : Filter(filterShaderFromUrl(filterFragmentUrl("color/colo
|
|||||||
hueShift = 0.0
|
hueShift = 0.0
|
||||||
gamma = 1.0
|
gamma = 1.0
|
||||||
opacity = 1.0
|
opacity = 1.0
|
||||||
|
clamped = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ uniform float contrast;
|
|||||||
uniform float hueShift;
|
uniform float hueShift;
|
||||||
uniform float gamma;
|
uniform float gamma;
|
||||||
uniform float opacity;
|
uniform float opacity;
|
||||||
|
uniform bool clamped;
|
||||||
|
|
||||||
uniform sampler2D tex0;
|
uniform sampler2D tex0;
|
||||||
in vec2 v_texCoord0;
|
in vec2 v_texCoord0;
|
||||||
@@ -61,5 +62,9 @@ void main() {
|
|||||||
nc.rgb = pow(nc.rgb, vec3(gamma));
|
nc.rgb = pow(nc.rgb, vec3(gamma));
|
||||||
nc.rgb = shiftHue(nc.rgb, (hueShift/360.0));
|
nc.rgb = shiftHue(nc.rgb, (hueShift/360.0));
|
||||||
vec4 cc = brightnessMatrix(brightness) * contrastMatrix((contrast + 1)) * saturationMatrix(saturation + 1) * nc;
|
vec4 cc = brightnessMatrix(brightness) * contrastMatrix((contrast + 1)) * saturationMatrix(saturation + 1) * nc;
|
||||||
o_color = vec4(cc.rgb, 1.0) * color.a * opacity;
|
if(clamped) {
|
||||||
|
o_color = clamp(vec4(cc.rgb, 1.0) * color.a * opacity, 0.0, 1.0);
|
||||||
|
} else {
|
||||||
|
o_color = vec4(cc.rgb, 1.0) * color.a * opacity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user