[vlc-devel] [PATCH 01/18] opengl: use common fragment shader for Android
Romain Vimont
rom1v at videolabs.io
Sat Dec 21 00:07:33 CET 2019
On Fri, Dec 20, 2019 at 03:48:43PM +0100, Romain Vimont wrote:
> @@ -315,12 +316,13 @@ static GLuint BuildVertexShader(const opengl_tex_converter_t *tc,
> "attribute vec4 MultiTexCoord0;\n"
> "%s%s"
> "attribute vec3 VertexPosition;\n"
> + "uniform mat4 TransformMatrix;\n"
> "uniform mat4 OrientationMatrix;\n"
> "uniform mat4 ProjectionMatrix;\n"
> "uniform mat4 ZoomMatrix;\n"
> "uniform mat4 ViewMatrix;\n"
> "void main() {\n"
> - " TexCoord0 = vec4(OrientationMatrix * MultiTexCoord0).st;\n"
> + " TexCoord0 = vec4(TransformMatrix * OrientationMatrix * MultiTexCoord0).st;\n"
Actually, the multiplication order must be reversed:
vec4(OrientationMatrix * TransformMatrix * MultiTexCoord0).st
TransformMatrix represents how the coordinates of the texture
initialized by the converter must be transformed, so it must be applied
first.
More information about the vlc-devel
mailing list