#include <cmath>
#include "ambientocclusion.h"
#include "blend.h"
+#include "renderer.h"
#include "shader.h"
#include "tests.h"
occlude_shdata.uniform("darkness", darkness);
}
-void AmbientOcclusion::render(const Texture2D &color, const Texture2D &depth)
+void AmbientOcclusion::render(Renderer &renderer, const Texture2D &color, const Texture2D &depth)
{
occlude_texturing.attach(0, depth);
combine_texturing.attach(0, depth);
combine_texturing.attach(1, color);
- BindRestore unbind_dtest(static_cast<DepthTest *>(0));
- BindRestore unbind_blend(static_cast<Blend *>(0));
- Bind bind_mesh(quad);
{
+ Renderer::Push push(renderer);
BindRestore bind_fbo(fbo);
- Bind bind_tex(occlude_texturing);
- Bind bind_shader(occlude_shader);
- occlude_shdata.apply();
- quad.draw();
+ renderer.set_texturing(&occlude_texturing);
+ renderer.set_shader_program(&occlude_shader, &occlude_shdata);
+ quad.draw(renderer);
}
- Bind bind_tex(combine_texturing);
- Bind bind_shader(combine_shader);
- combine_shdata.apply();
- quad.draw();
+ Renderer::Push push(renderer);
+ renderer.set_texturing(&combine_texturing);
+ renderer.set_shader_program(&combine_shader, &combine_shdata);
+ quad.draw(renderer);
}
} // namespace GL