How to enable antialias/multisampling when rendering to framebuffer with stencil buffer for webgl2?

88 Views Asked by At

I add samples: 4 and change gl.RGBA to gl.RGBA4 to enable antialias of first framebuffer attachment:

const framebufferInfo = twgl.createFramebufferInfo(gl, [
  { format: gl.RGBA4, type: gl.UNSIGNED_BYTE, min: gl.LINEAR, wrap: gl.CLAMP_TO_EDGE, samples: 4 },
  { format: gl.DEPTH_STENCIL, samples: 4 },
], canvas.width, canvas.height)

I got error of renderbufferStorageMultisample: internalformat invalid for samples > 0.

0

There are 0 best solutions below