+ (*i)->render(*color_buf, *depth_buf);
+}
+
+void Pipeline::create_fbos()
+{
+ delete fbo;
+ delete color_buf;
+ delete depth_buf;
+
+ delete fbo_ms;
+ fbo_ms = 0;
+ delete color_buf_ms;
+ color_buf_ms = 0;
+ delete depth_buf_ms;
+ depth_buf_ms = 0;
+
+ fbo = new Framebuffer;
+
+ color_buf = new Texture2D;
+ color_buf->set_min_filter(NEAREST);
+ color_buf->set_mag_filter(NEAREST);
+ color_buf->set_wrap(CLAMP_TO_EDGE);
+ color_buf->storage((hdr ? RGB16F : RGB), width, height);
+ fbo->attach(COLOR_ATTACHMENT0, *color_buf, 0);
+
+ depth_buf = new Texture2D;
+ depth_buf->set_min_filter(NEAREST);
+ depth_buf->set_mag_filter(NEAREST);
+ depth_buf->set_wrap(CLAMP_TO_EDGE);
+ depth_buf->storage(DEPTH_COMPONENT, width, height);
+ fbo->attach(DEPTH_ATTACHMENT, *depth_buf, 0);
+
+ if(samples)
+ {
+ fbo_ms = new Framebuffer;
+
+ color_buf_ms = new Renderbuffer;
+ color_buf_ms->storage_multisample(samples, (hdr ? RGB16F : RGB), width, height);
+ fbo_ms->attach(COLOR_ATTACHMENT0, *color_buf_ms);
+
+ depth_buf_ms = new Renderbuffer;
+ depth_buf_ms->storage_multisample(samples, DEPTH_COMPONENT, width, height);
+ fbo_ms->attach(DEPTH_ATTACHMENT, *depth_buf_ms);
+ }