gles transition almost complete

This commit is contained in:
itsmattkc
2019-03-17 23:49:06 +11:00
parent 05ac0314d7
commit 862996e8a3
12 changed files with 257 additions and 189 deletions
+3 -1
View File
@@ -4,8 +4,10 @@ precision mediump float;
#endif
uniform sampler2D texture;
uniform float opacity;
varying vec2 v_texcoord;
void main() {
gl_FragColor = texture2D(texture, v_texcoord);
vec4 color = texture2D(texture, v_texcoord)*opacity;
gl_FragColor = color;
}
+2 -5
View File
@@ -78,10 +78,7 @@ void ShakeEffect::process_coords(double timecode, GLTextureCoords& coords, int)
yoff *= multiplier;
rotoff *= rotmult;
coords.vertex_top_left += QVector3D(xoff, yoff, 0.0);
coords.vertex_top_right += QVector3D(xoff, yoff, 0.0);
coords.vertex_bottom_left += QVector3D(xoff, yoff, 0.0);
coords.vertex_bottom_right += QVector3D(xoff, yoff, 0.0);
coords.matrix.translate(xoff, yoff, 0.0);
glRotatef(rotoff, 0, 0, 1);
coords.matrix.rotate(QQuaternion::fromEulerAngles(0.0f, 0.0f, rotoff));
}
+5 -5
View File
@@ -190,9 +190,9 @@ void TransformEffect::toggle_uniform_scale(bool enabled) {
void TransformEffect::process_coords(double timecode, GLTextureCoords& coords, int) {
// position
glTranslated(position_x->GetDoubleAt(timecode)-(parent_clip->sequence->width/2),
position_y->GetDoubleAt(timecode)-(parent_clip->sequence->height/2),
0);
coords.matrix.translate(position_x->GetDoubleAt(timecode)-(parent_clip->sequence->width/2),
position_y->GetDoubleAt(timecode)-(parent_clip->sequence->height/2),
0);
// anchor point
int anchor_x_offset = qRound(anchor_x_box->GetDoubleAt(timecode));
@@ -204,12 +204,12 @@ void TransformEffect::process_coords(double timecode, GLTextureCoords& coords, i
coords.vertex_bottom_right -= QVector3D(anchor_x_offset, anchor_y_offset, 0.0f);
// rotation
glRotated(rotation->GetDoubleAt(timecode), 0, 0, 1);
coords.matrix.rotate(QQuaternion::fromEulerAngles(0, 0, rotation->GetDoubleAt(timecode)));
// scale
double sx = scale_x->GetDoubleAt(timecode)*0.01;
double sy = (uniform_scale_field->GetBoolAt(timecode)) ? sx : scale_y->GetDoubleAt(timecode)*0.01;
glScaled(sx, sy, 1);
coords.matrix.scale(sx, sy);
// blend mode
coords.blendmode = blend_mode_box->GetValueAt(timecode).toInt();