#include "ambientocclusion.h"
#include "blend.h"
#include "camera.h"
+#include "mesh.h"
#include "renderer.h"
#include "resources.h"
+#include "texture2d.h"
using namespace std;
namespace Msp {
namespace GL {
-AmbientOcclusion::AmbientOcclusion(unsigned w, unsigned h, float):
+AmbientOcclusion::AmbientOcclusion(unsigned w, unsigned h):
rotate_lookup(get_or_create_rotate_lookup()),
occlude_target(w, h, (COLOR_ATTACHMENT,R8)),
occlude_shader(Resources::get_global().get<Program>("_ambientocclusion_occlude.glsl.shader")),
{
Resources &resources = Resources::get_global();
- static const string name = "_ambientocclusion_rotate.tex2d";
+ static const string name = "_ambientocclusion_rotate.tex";
Texture2D *rotate_lookup = resources.find<Texture2D>(name);
if(rotate_lookup)
return *rotate_lookup;
}
-AmbientOcclusion::Template::Template():
- n_samples(16),
- occlusion_radius(0.5f),
- darkness(1.0f),
- edge_depth_threshold(0.1f)
-{ }
-
AmbientOcclusion *AmbientOcclusion::Template::create(unsigned width, unsigned height) const
{
RefPtr<AmbientOcclusion> ao = new AmbientOcclusion(width/size_divisor, height/size_divisor);