theLemon505 / DarkMatter-Game-Engine-lowpoly

a java game engine for lowpoly games
2 stars 0 forks source link

Missing Texture Parameters for Squashing Stretching #1

Open codingminecraft opened 3 years ago

codingminecraft commented 3 years ago

https://github.com/theLemon505/DarkMatter-Game-Engine-lowpoly/blob/385f14053e69bbd10d2e5df0eb9d41ee36cf4788/DarkMatter%20Engine/src/CoreEngine/Graphics/Texture.java#L29

If you include these two lines here:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

It will fix your framebuffer issues. It's very important to add the texture parameters for squashing and stretching an image when you create a new texture. Otherwise, if you try to draw the texture at anything other than it's original resolution it will just draw a black screen. Let me know if that helps you out.

theLemon505 commented 2 years ago

I know m this is years later, and several rendering engines later, but that was in fact the solution. Thanks!