[vlc-devel] [PATCH] opengl: fix matrix multiplication order

Thomas Guillem thomas at gllm.fr
Mon Jan 27 13:41:33 CET 2020


Pushed, thanks!

On Sat, Jan 25, 2020, at 17:09, Romain Vimont wrote:
> The orientation matrix must be applied on the input coordinates, before
> the (internal) Android transformation, which depends on how the texture
> is actually stored.
> 
> For example, if the orientation matrix represents a vertical flip,
> "vertical" is only meaningful on the input coordinates (if the Android
> transformation rotates by 90°, the vertical flip would result in an
> horizontal flip instead).
> 
> The first version was actually correct:
> <https://mailman.videolan.org/pipermail/vlc-devel/2019-December/130153.html>
> ---
>  modules/video_output/opengl/vout_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/modules/video_output/opengl/vout_helper.c 
> b/modules/video_output/opengl/vout_helper.c
> index af2fd80bc0..a9fa1b8da4 100644
> --- a/modules/video_output/opengl/vout_helper.c
> +++ b/modules/video_output/opengl/vout_helper.c
> @@ -322,7 +322,7 @@ static GLuint BuildVertexShader(const 
> opengl_tex_converter_t *tc,
>          "uniform mat4 ZoomMatrix;\n"
>          "uniform mat4 ViewMatrix;\n"
>          "void main() {\n"
> -        " TexCoord0 = vec4(OrientationMatrix * TransformMatrix * 
> MultiTexCoord0).st;\n"
> +        " TexCoord0 = vec4(TransformMatrix * OrientationMatrix * 
> MultiTexCoord0).st;\n"
>          "%s%s"
>          " gl_Position = ProjectionMatrix * ZoomMatrix * ViewMatrix\n"
>          "               * vec4(VertexPosition, 1.0);\n"
> -- 
> 2.25.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list