This commit is contained in:
auria.mg 2016-08-15 20:33:11 -04:00
commit 084fa04012
2 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,5 @@
uniform sampler2D tex;
uniform float scale;
out vec4 FragColor;
@ -7,7 +8,7 @@ out vec4 FragColor;
void main()
{
vec2 uv = gl_FragCoord.xy / 512.;
vec2 uv = gl_FragCoord.xy / (512. * scale);
vec3 col = texture(tex, uv).xyz;
vec3 Yxy = getCIEYxy(col);
vec3 WhiteYxy = getCIEYxy(vec3(1.));

View File

@ -327,21 +327,21 @@ public:
}; // ComputeGaussian17TapVShader
// ============================================================================
class BloomShader : public TextureShader<BloomShader, 1>
class BloomShader : public TextureShader<BloomShader, 1, float>
{
public:
BloomShader()
{
loadProgram(OBJECT, GL_VERTEX_SHADER, "screenquad.vert",
GL_FRAGMENT_SHADER, "bloom.frag");
assignUniforms();
assignUniforms("scale");
assignSamplerNames(0, "tex", ST_NEAREST_FILTERED);
} // BloomShader
// ------------------------------------------------------------------------
void render(GLuint in)
{
BloomShader::getInstance()->setTextureUnits(in);
drawFullScreenEffect();
drawFullScreenEffect(UserConfigParams::m_scale_rtts_factor);
} // render
}; // BloomShader