Open TurtleZhong opened 1 year ago
Hi, I faced the same problem and here is my solution:
Add one line of code in the vertex shader of the compile_shader() function to vertically flip the uv coordinates:
vertex_shader_source = """
#version 450 core
out vec2 uv;
void main( void)
{
// Declare a hard-coded array of positions
const vec2 vertices[4] = vec2[4](vec2(-0.5, 0.5),
vec2( 0.5, 0.5),
vec2( 0.5, -0.5),
vec2(-0.5, -0.5));
// Index into our array using gl_VertexID
uv=vertices[gl_VertexID]+vec2(0.5,0.5);
uv.y = 1.0 - uv.y; // Flip the texture vertically
gl_Position = vec4(2*vertices[gl_VertexID],1.0,1.0);
}
"""
Hopefully, this will also work for you.
Describe the bug In samples/SampleOpenGL.py, the rendering effect of OpenGL is flipped vertically. here is the origin video in tests/test.mp4
and below is the render results of OpenGL
To Reproduce Steps to reproduce the behavior:
Screenshots
https://github.com/NVIDIA/VideoProcessingFramework/assets/19700579/eb4e773c-8d73-4f2d-a257-ce4efe32305c
Desktop (please complete the following information):