- depth_buf_ms = new Renderbuffer;
- depth_buf_ms->storage_multisample(samples, DEPTH_COMPONENT, width, height);
- fbo_ms->attach(DEPTH_ATTACHMENT, *depth_buf_ms);
+ PixelFormat color_pf = (hdr ? (alpha ? RGBA16F : RGB16F) : (alpha ? RGBA8 : RGB8));
+ RenderTargetFormat fmt = (RENDER_COLOR,color_pf, RENDER_DEPTH);
+ if(!postproc.empty() || samples)
+ {
+ if(!target[0])
+ target[0] = new RenderTarget(width, height, fmt);
+ if(!target[1] && postproc.size()>1)
+ target[1] = new RenderTarget(width, height, fmt);