X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Feffects%2Fambientocclusion.cpp;h=d23469edf8aeeac20a0a62cf285e47dde551f019;hp=d47d18aaa8a6f6992ffb800f29463ee70b87aea2;hb=fe2fc291a4fc618425c64112c9ffd3519f0b8a3e;hpb=08d0a9f283b71e874b769b2661389b0aca598f4f diff --git a/source/effects/ambientocclusion.cpp b/source/effects/ambientocclusion.cpp index d47d18aa..d23469ed 100644 --- a/source/effects/ambientocclusion.cpp +++ b/source/effects/ambientocclusion.cpp @@ -12,13 +12,13 @@ using namespace std; namespace Msp { namespace GL { -AmbientOcclusion::AmbientOcclusion(Resources &resources, unsigned w, unsigned h, float): +AmbientOcclusion::AmbientOcclusion(unsigned w, unsigned h, float): occlude_target(w, h, (RENDER_COLOR,R8)), - occlude_shader(resources.get("_ambientocclusion_occlude.glsl.shader")), - combine_shader(resources.get("_ambientocclusion_combine.glsl.shader")), - quad(resources.get("_fullscreen_quad.mesh")), - linear_sampler(resources.get("_linear_clamp.samp")), - nearest_sampler(resources.get("_nearest_clamp.samp")) + occlude_shader(Resources::get_global().get("_ambientocclusion_occlude.glsl.shader")), + combine_shader(Resources::get_global().get("_ambientocclusion_combine.glsl.shader")), + quad(Resources::get_global().get("_fullscreen_quad.mesh")), + linear_sampler(Resources::get_global().get("_linear_clamp.samp")), + nearest_sampler(Resources::get_global().get("_nearest_clamp.samp")) { unsigned seed = 1; rotate_lookup.storage(RGBA8, 4, 4, 1); @@ -111,9 +111,9 @@ AmbientOcclusion::Template::Template(): edge_depth_threshold(0.1f) { } -AmbientOcclusion *AmbientOcclusion::Template::create(Resources &res, unsigned width, unsigned height) const +AmbientOcclusion *AmbientOcclusion::Template::create(unsigned width, unsigned height) const { - RefPtr ao = new AmbientOcclusion(res, width/size_divisor, height/size_divisor); + RefPtr 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);