#๐Ÿ”’ OpenGL Texture issue

4 messages ยท Page 1 of 1 (latest)

modern cairnBOT
#

@blazing gull

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

blazing gull
#

Hello, I'm trying to render a 2d animated textures with GLFW and OpenGL but on screen, some part of the animation look quite strange and I have no idea where it's coming from. (I'm new to OpenGL and the way I did it may not be the usual method. I'm all ears for better implementations)

Here's the output : some pixels on the first frame are shifted

#

Here's my code :
opengl_test.py
https://paste.pythondiscord.com/ZQQQ

shader.vert

#version 330 core

layout (location=0) in vec2 vertexPos;
layout (location=1) in vec2 vertexTexCoord;

uniform vec2 tilePos;
uniform vec2 cameraPos;
uniform mat2 cameraSize;

uniform vec2 texPos;
uniform mat2 texSize;

out vec2 fragmentTexCoord;

void main() {
    gl_Position =  vec4(cameraSize * (tilePos - cameraPos + vertexPos), 0, 1);
    fragmentTexCoord = texSize * vertexTexCoord + texPos;
}

shader.frag

#version 330 core

in vec2 fragmentTexCoord;

out vec4 color;

uniform sampler2D imageTexture;

void main() {
    color = texture(imageTexture, fragmentTexCoord);
}

test3.png

modern cairnBOT
#

@blazing gull

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.