void render_highpassfilter_noext (float threshold_R, float threshold_G, float threshold_B) { // invert color buffer glBlendFunc (GL_ONE_MINUS_DST_COLOR, GL_ZERO); glColor4f (1,1,1,1); screenquad (); // add the threshold glBlendFunc (GL_ONE, GL_ONE); glColor4f (threshold_R, threshold_G, threshold_B, 1); screenquad (); // invert color buffer glBlendFunc (GL_ONE_MINUS_DST_COLOR, GL_ZERO); glColor4f (1,1,1,1); screenquad (); }
void render_highpassfilter_ext (float threshold_R, float threshold_G, float threshold_B) { // substract the threshold glBlendFunc (GL_ONE, GL_ONE); glBlendEquationEXT (GL_FUNC_REVERSE_SUBTRACT_EXT); glColor4f (threshold_R, threshold_G, threshold_B, 0); screenquad (); glBlendEquationEXT (GL_FUNC_ADD_EXT); }
void addglare() { if(!glare) return; glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); SETSHADER(screenrect); glBindTexture(GL_TEXTURE_2D, glaretex.rendertex); gle::colorf(glarescale, glarescale, glarescale); screenquad(1, 1); glDisable(GL_BLEND); }