[vlc-commits] opengl: fix xyz12 fragment shader
Romain Vimont
git at videolan.org
Thu Apr 2 11:28:13 CEST 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Tue Mar 31 11:05:38 2020 +0200| [b6a622e275e92bb89a94e23be8d1a142f72b93e8] | committer: Steve Lhomme
opengl: fix xyz12 fragment shader
Commits bf4f21b54f03e7b33c5c55d3171caf06d1482459 and
cb16845b7e1244f3a7085276489f9dd2e01a2949 moved transformations from the
renderer to the (sampler) fragment shader.
But the transformations were applied only on the "main" fragment shader.
Also apply them on the specific fragment shader generated for XYZ12
chroma.
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b6a622e275e92bb89a94e23be8d1a142f72b93e8
---
modules/video_output/opengl/fragment_shaders.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index 9bc7e9b6bd..117020cbe7 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -347,10 +347,16 @@ xyz12_shader_init(struct vlc_gl_renderer *renderer)
" 0.0, 0.0, 0.0, 1.0 "
" );"
+ "uniform mat4 TransformMatrix;\n"
+ "uniform mat4 OrientationMatrix;\n"
+ "uniform mat3 TexCoordsMap0;\n"
"vec4 vlc_texture(vec2 pic_coords)\n"
"{ "
" vec4 v_in, v_out;"
- " v_in = texture2D(Texture0, pic_coords);"
+ /* Homogeneous (oriented) coordinates */
+ " vec3 pic_hcoords = vec3((TransformMatrix * OrientationMatrix * vec4(pic_coords, 0.0, 1.0)).st, 1.0);\n"
+ " vec2 tex_coords = (TexCoordsMap0 * pic_hcoords).st;\n"
+ " v_in = texture2D(Texture0, tex_coords);\n"
" v_in = pow(v_in, xyz_gamma);"
" v_out = matrix_xyz_rgb * v_in ;"
" v_out = pow(v_out, rgb_gamma) ;"
More information about the vlc-commits
mailing list