[orx-fx] Add radius parameter to Perturb
This commit is contained in:
@@ -19,6 +19,9 @@ class Perturb : Filter(mppFilterShader(fx_perturb, "perturb")) {
|
|||||||
@DoubleParameter("phase", -2.0, 2.0, order = 1)
|
@DoubleParameter("phase", -2.0, 2.0, order = 1)
|
||||||
var phase: Double by parameters
|
var phase: Double by parameters
|
||||||
|
|
||||||
|
@DoubleParameter("radius", 0.0, 2.0, order = 1)
|
||||||
|
var radius: Double by parameters
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lacunarity is the amount by which scale is modulated per octave, default is Vector3(2.0, 2.0, 2.0)
|
* lacunarity is the amount by which scale is modulated per octave, default is Vector3(2.0, 2.0, 2.0)
|
||||||
*/
|
*/
|
||||||
@@ -62,6 +65,7 @@ class Perturb : Filter(mppFilterShader(fx_perturb, "perturb")) {
|
|||||||
ySegments = 0
|
ySegments = 0
|
||||||
outputUV = false
|
outputUV = false
|
||||||
offset = Vector2.ZERO
|
offset = Vector2.ZERO
|
||||||
|
radius = 1.0
|
||||||
|
|
||||||
}
|
}
|
||||||
var bicubicFiltering = true
|
var bicubicFiltering = true
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
uniform float gain;
|
uniform float gain;
|
||||||
uniform vec3 seed;
|
uniform vec3 seed;
|
||||||
uniform float phase;
|
uniform float phase;
|
||||||
|
uniform float radius;
|
||||||
uniform float scale;
|
uniform float scale;
|
||||||
|
|
||||||
uniform float lacunarity;
|
uniform float lacunarity;
|
||||||
@@ -141,8 +142,8 @@ void main() {
|
|||||||
float _gain = gain;
|
float _gain = gain;
|
||||||
float shift = 100.0;
|
float shift = 100.0;
|
||||||
|
|
||||||
vec3 xseed = vec3(seed.xy, seed.z+cos(phase*3.1415926535));
|
vec3 xseed = vec3(seed.xy, seed.z+radius*cos(phase*3.1415926535));
|
||||||
vec3 yseed = vec3(seed.yx, seed.z+sin(phase*3.1415926535));
|
vec3 yseed = vec3(seed.yx, seed.z+radius*sin(phase*3.1415926535));
|
||||||
|
|
||||||
vec3 uv = vec3(v_texCoord0 + offset, 1.0) * 2.0 - 1.0;
|
vec3 uv = vec3(v_texCoord0 + offset, 1.0) * 2.0 - 1.0;
|
||||||
vec3 px = ((segment(uv, xSegments, ySegments) + xseed) * scale);
|
vec3 px = ((segment(uv, xSegments, ySegments) + xseed) * scale);
|
||||||
|
|||||||
Reference in New Issue
Block a user