Revert "Clean bloomblending since it's not used anymore"

This reverts commit 2206f8ad5c.

Conflicts:

	src/graphics/post_processing.cpp
This commit is contained in:
hiker 2015-03-16 08:49:36 +11:00
parent d9375c9a43
commit d09f6d3c7a
4 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,14 @@
uniform sampler2D tex_128;
uniform sampler2D tex_256;
uniform sampler2D tex_512;
out vec4 FragColor;
void main()
{
vec2 uv = gl_FragCoord.xy / screen;
vec4 col = .125 * texture(tex_128, uv);
col += .25 * texture(tex_256, uv);
col += .5 * texture(tex_512, uv);
FragColor = vec4(col.xyz, 1.);
}

View File

@ -742,7 +742,7 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode, boo
renderGaussian6Blur(irr_driver->getFBO(FBO_BLOOM_256), irr_driver->getFBO(FBO_TMP_256), 1., 1.);
renderGaussian6Blur(irr_driver->getFBO(FBO_BLOOM_128), irr_driver->getFBO(FBO_TMP_128), 1., 1.);
// Additively blend
// Additively blend on top of tmp1
in_fbo->Bind();
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);

View File

@ -1570,6 +1570,16 @@ namespace FullScreenShader
AssignSamplerNames(Program, 0, "tex");
}
BloomBlendShader::BloomBlendShader()
{
Program = LoadProgram(OBJECT,
GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(),
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/bloomblend.frag").c_str());
AssignUniforms();
AssignSamplerNames(Program, 0, "tex_128", 1, "tex_256", 2, "tex_512");
}
LensBlendShader::LensBlendShader()
{

View File

@ -388,6 +388,12 @@ public:
BloomShader();
};
class BloomBlendShader : public ShaderHelperSingleton<BloomBlendShader>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
{
public:
BloomBlendShader();
};
class LensBlendShader : public ShaderHelperSingleton<LensBlendShader>, public TextureRead<Bilinear_Filtered, Bilinear_Filtered, Bilinear_Filtered>
{
public: