]> git.tdb.fi Git - libs/gl.git/commitdiff
Use linear filtering for ambient occlusion render target
authorMikko Rasa <tdb@tdb.fi>
Fri, 6 Jan 2017 16:15:43 +0000 (18:15 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 6 Jan 2017 16:15:43 +0000 (18:15 +0200)
The blurring step samples it exactly between texels so nearest filtering
may cause artifacts due to floating point math instability.

source/ambientocclusion.cpp

index af1008b4230cf3283c2fe3362c6815f71d6c078c..5edbf833e32d72d7a3b1eb0393f6b9157b59bb42 100644 (file)
@@ -17,6 +17,7 @@ AmbientOcclusion::AmbientOcclusion(unsigned w, unsigned h, float):
        combine_shader("ambientocclusion_combine.glsl"),
        quad(get_fullscreen_quad())
 {
+       occlude_target.set_texture_filter(LINEAR);
        texturing.attach(2, occlude_target.get_target_texture(RENDER_COLOR));
 
        unsigned seed = 1;