quad.draw(renderer);
}
+
+AmbientOcclusion::Template::Template():
+ n_samples(16),
+ occlusion_radius(0.5f),
+ darkness(1.0f)
+{ }
+
+AmbientOcclusion *AmbientOcclusion::Template::create(unsigned width, unsigned height) const
+{
+ RefPtr<AmbientOcclusion> ao = new AmbientOcclusion(width/size_divisor, height/size_divisor);
+ ao->set_n_samples(n_samples);
+ ao->set_occlusion_radius(occlusion_radius);
+ ao->set_darkness(darkness);
+ return ao.release();
+}
+
+
+AmbientOcclusion::Template::Loader::Loader(Template &t):
+ DataFile::DerivedObjectLoader<Template, PostProcessor::Template::Loader>(t)
+{
+ add("darkness", &Template::darkness);
+ add("occlusion_radius", &Template::occlusion_radius);
+ add("samples", &Template::n_samples);
+}
+
} // namespace GL
} // namespace Msp
*/
class AmbientOcclusion: public PostProcessor
{
+public:
+ struct Template: PostProcessor::Template
+ {
+ class Loader: public DataFile::DerivedObjectLoader<Template, PostProcessor::Template::Loader>
+ {
+ public:
+ Loader(Template &);
+ };
+
+ unsigned n_samples;
+ float occlusion_radius;
+ float darkness;
+
+ Template();
+
+ virtual AmbientOcclusion *create(unsigned, unsigned) const;
+ };
+
private:
Texture2D rotate_lookup;
RenderTarget occlude_target;
#include <msp/core/maputils.h>
#include <msp/datafile/collection.h>
+#include "ambientocclusion.h"
#include "blend.h"
#include "bloom.h"
#include "colorcurve.h"
void PipelineTemplate::Loader::init()
{
+ add("ambient_occlusion", &Loader::postprocessor<AmbientOcclusion>);
add("bloom", &Loader::postprocessor<Bloom>);
add("colorcurve", &Loader::postprocessor<ColorCurve>);
add("hdr", &PipelineTemplate::hdr);