From 0c1fab7813e12580bed0852d9e57b0a3f2768d83 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 3 Oct 2012 12:31:37 +0200 Subject: [PATCH] Set better texture environment for the intermediate textures. --- effect_chain.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/effect_chain.cpp b/effect_chain.cpp index b83e81e..19c485c 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -224,6 +224,10 @@ void EffectChain::finalize() for (unsigned i = 0; i < num_textures; ++i) { glBindTexture(GL_TEXTURE_2D, temp_textures[i]); check_error(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + check_error(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + check_error(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, empty); check_error(); } @@ -334,7 +338,7 @@ void EffectChain::render_to_screen(unsigned char *src) if (phases[phase].input_needs_mipmaps) { glGenerateMipmap(GL_TEXTURE_2D); check_error(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); check_error(); } else { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -399,5 +403,7 @@ void EffectChain::render_to_screen(unsigned char *src) glActiveTexture(GL_TEXTURE0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); check_error(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1000); + check_error(); } } -- 2.39.5