wave effect axis, fixed folder bugs, timecode to frame number, drag from footage viewer, track resizing bug
This commit is contained in:
@@ -4,19 +4,26 @@
|
||||
uniform float frequency;
|
||||
uniform float intensity;
|
||||
uniform float evolution;
|
||||
uniform bool vertical;
|
||||
|
||||
uniform mediump float amount_val;
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main(void) {
|
||||
float offset = sin((vTexCoord.x-evolution)*frequency)*intensity;
|
||||
float x = vTexCoord.x;
|
||||
float y = vTexCoord.y;
|
||||
|
||||
float y = vTexCoord.y-offset;
|
||||
if (y < 0.0 || y > 1.0) {
|
||||
if (vertical) {
|
||||
x -= sin((vTexCoord.y-evolution)*frequency)*intensity;
|
||||
} else {
|
||||
y -= sin((vTexCoord.x-evolution)*frequency)*intensity;
|
||||
}
|
||||
|
||||
if (y < 0.0 || y > 1.0 || x < 0.0 || x > 1.0) {
|
||||
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
} else {
|
||||
vec4 textureColor = texture2D(myTexture, vec2(vTexCoord.x, y));
|
||||
vec4 textureColor = texture2D(myTexture, vec2(x, y));
|
||||
gl_FragColor = vec4(
|
||||
textureColor.r,
|
||||
textureColor.g,
|
||||
|
||||
@@ -13,9 +13,13 @@ WaveEffect::WaveEffect(Clip* c) : Effect(c, EFFECT_TYPE_VIDEO, VIDEO_WAVE_EFFECT
|
||||
evolution_val = add_row("Evolution:")->add_field(EFFECT_FIELD_DOUBLE);
|
||||
evolution_val->set_double_default_value(0);
|
||||
|
||||
vertical_val = add_row("Vertical:")->add_field(EFFECT_FIELD_BOOL);
|
||||
vertical_val->set_bool_value(false);
|
||||
|
||||
connect(frequency_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(intensity_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(evolution_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
connect(vertical_val, SIGNAL(changed()), this, SLOT(field_changed()));
|
||||
|
||||
vertPath = ":/shaders/common.vert";
|
||||
fragPath = ":/shaders/waveeffect.frag";
|
||||
@@ -25,4 +29,5 @@ void WaveEffect::process_shader(double timecode) {
|
||||
glslProgram->setUniformValue("frequency", (GLfloat) (frequency_val->get_double_value(timecode)));
|
||||
glslProgram->setUniformValue("intensity", (GLfloat) (intensity_val->get_double_value(timecode)*0.01));
|
||||
glslProgram->setUniformValue("evolution", (GLfloat) (evolution_val->get_double_value(timecode)*0.01));
|
||||
glslProgram->setUniformValue("vertical", vertical_val->get_bool_value(timecode));
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ private:
|
||||
EffectField* frequency_val;
|
||||
EffectField* intensity_val;
|
||||
EffectField* evolution_val;
|
||||
|
||||
EffectField* vertical_val;
|
||||
};
|
||||
|
||||
#endif // WAVEEFFECT_H
|
||||
|
||||
Reference in New Issue
Block a user