mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-02 00:43:29 +00:00
- 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:
parent
2e4ffbb1d1
commit
1b6f77a473
1 changed files with 2 additions and 2 deletions
|
@ -234,12 +234,12 @@ void PostProcessShaderInstance::BindTextures()
|
||||||
{
|
{
|
||||||
FBitmap bitmap;
|
FBitmap bitmap;
|
||||||
bitmap.Create(tex->GetWidth(), tex->GetHeight());
|
bitmap.Create(tex->GetWidth(), tex->GetHeight());
|
||||||
tex->CopyTrueColorPixels(&bitmap, 0, 0);
|
tex->CopyTrueColorPixels(&bitmap, 0, 0, 6);
|
||||||
|
|
||||||
GLuint handle = 0;
|
GLuint handle = 0;
|
||||||
glGenTextures(1, &handle);
|
glGenTextures(1, &handle);
|
||||||
glBindTexture(GL_TEXTURE_2D, 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_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
mTextureHandles[tex] = handle;
|
mTextureHandles[tex] = handle;
|
||||||
|
|
Loading…
Reference in a new issue