X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain.cpp;h=fa7340d7a456839f7ef2563d76c5a872182491ff;hp=19d89f823c313b6faca3bcdd3c1aef505f762f8d;hb=72c893b5313744226d9496e8682071dfb373d56c;hpb=88003f99c7ef12ed895e504d41c6d528c3fda78d diff --git a/effect_chain.cpp b/effect_chain.cpp index 19d89f8..fa7340d 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -32,12 +32,13 @@ using namespace std; namespace movit { -EffectChain::EffectChain(float aspect_nom, float aspect_denom, ResourcePool *resource_pool) +EffectChain::EffectChain(float aspect_nom, float aspect_denom, ResourcePool *resource_pool, GLenum intermediate_format) : aspect_nom(aspect_nom), aspect_denom(aspect_denom), output_color_rgba(false), output_color_ycbcr(false), dither_effect(NULL), + intermediate_format(intermediate_format), num_dither_bits(0), output_origin(OUTPUT_ORIGIN_BOTTOM_LEFT), finalized(false), @@ -1692,6 +1693,8 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height check_error(); glDisable(GL_DITHER); check_error(); + glEnable(GL_FRAMEBUFFER_SRGB); + check_error(); // Save original viewport. GLuint x = 0, y = 0; @@ -1853,7 +1856,7 @@ void EffectChain::execute_phase(Phase *phase, bool last_phase, if (!last_phase) { find_output_size(phase); - GLuint tex_num = resource_pool->create_2d_texture(GL_RGBA16F, phase->output_width, phase->output_height); + GLuint tex_num = resource_pool->create_2d_texture(intermediate_format, phase->output_width, phase->output_height); output_textures->insert(make_pair(phase, tex_num)); }