occlusion.set_mag_filter(NEAREST);
occlusion.set_wrap(CLAMP_TO_EDGE);
fbo.attach(COLOR_ATTACHMENT0, occlusion, 0);
+ fbo.require_complete();
combine_texturing.attach(2, occlusion);
tex[i].set_min_filter(NEAREST);
tex[i].set_wrap(CLAMP_TO_EDGE);
tex[i].storage(RGB16F, w, h);
+ fbo[i].attach(COLOR_ATTACHMENT0, tex[i], 0);
+ fbo[i].require_complete();
}
combine_shdata.uniform("source", 1);
{
Bind bind_shader(blur_shader);
blur_shdata_common.apply();
- Bind bind_fbo(fbo, true);
for(unsigned i=0; i<2; ++i)
{
+ Bind bind_fbo(fbo[i], true);
Bind bind_tex(i ? tex[0] : src);
- fbo.attach(COLOR_ATTACHMENT0, tex[i], 0);
blur_shdata[i].apply();
quad.draw();
}
{
fbo[i].attach(COLOR_ATTACHMENT0, env_tex, TextureCube::enumerate_faces(i), 0);
fbo[i].attach(DEPTH_ATTACHMENT, depth_buf);
+ fbo[i].require_complete();
}
// XXX Make the depth range configurable
depth_buf.set_wrap(CLAMP_TO_EDGE);
depth_buf.storage(DEPTH_COMPONENT, size, size);
fbo.attach(DEPTH_ATTACHMENT, depth_buf, 0);
+ fbo.require_complete();
set_darkness(0.7);
set_texture_unit(3);