It should be done just before rendering into the target starts.
renderer.set_shader_program(&occlude_shader, &shdata);
renderer.set_framebuffer(&occlude_target.get_framebuffer());
+ renderer.clear(0);
quad.draw(renderer);
renderer.set_framebuffer(out_fbo);
+ renderer.clear(0);
renderer.set_shader_program(&combine_shader);
quad.draw(renderer);
}
{
Renderer::Push push2(renderer);
renderer.set_framebuffer(&target[i]->get_framebuffer());
+ renderer.clear(0);
renderer.set_texture("source", (i ? &target[0]->get_target_texture(COLOR_ATTACHMENT) : &src), &nearest_sampler);
renderer.add_shader_data(blur_shdata[i]);
quad.draw(renderer);
}
+ renderer.clear(0);
renderer.set_texture("source", &src, &nearest_sampler);
renderer.set_texture("blurred", &target[1]->get_target_texture(COLOR_ATTACHMENT), &linear_sampler);
renderer.set_shader_program(&combine_shader);
void ColorCurve::render(Renderer &renderer, const Texture2D &color_buf, const Texture2D &)
{
Renderer::Push push(renderer);
+ renderer.clear(0);
renderer.set_shader_program(&shprog, &shdata);
renderer.set_texture("source", &color_buf, &nearest_sampler);
renderer.set_texture("curve", &curve, &linear_sampler);
{
unsigned j = i%2;
renderer.set_framebuffer(i+1<postproc.size() ? &target[1-j]->get_framebuffer() : out_fbo);
- renderer.clear(0);
const Texture2D &color = target[j]->get_target_texture(COLOR_ATTACHMENT);
const Texture2D &depth = target[j]->get_target_texture(DEPTH_ATTACHMENT);
postproc[i]->render(renderer, color, depth);