- fixed: inverted vertically texture uniforms for custom post-process shaders, and also changed their input format to BGRA to match the standard.

This commit is contained in:
Rachael Alexanderson 2017-10-12 11:54:56 -04:00
parent 2e4ffbb1d1
commit 1b6f77a473

View file

@ -234,12 +234,12 @@ void PostProcessShaderInstance::BindTextures()
{
FBitmap bitmap;
bitmap.Create(tex->GetWidth(), tex->GetHeight());
tex->CopyTrueColorPixels(&bitmap, 0, 0);
tex->CopyTrueColorPixels(&bitmap, 0, 0, 6);
GLuint handle = 0;
glGenTextures(1, &handle);
glBindTexture(GL_TEXTURE_2D, handle);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex->GetWidth(), tex->GetHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmap.GetPixels());
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex->GetWidth(), tex->GetHeight(), 0, GL_BGRA, GL_UNSIGNED_BYTE, bitmap.GetPixels());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
mTextureHandles[tex] = handle;