pezcode / Cluster

Clustered shading implementation with bgfx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MSAA?

VinnyVicious opened this issue · comments

Results are very noisy without any filtering. Is it possible to add MSAA to this rendering technique?

image

It looks like your textures don't have mipmaps. MSAA only helps with anti-aliasing along triangle edges.

But yes, you can enable MSAA by creating the intermediate framebuffer attachments with MSAA. Try adding BGFX_TEXTURE_RT_MSAA_X4 to the createTexture2D() calls here:

bgfx::FrameBufferHandle Renderer::createFrameBuffer(bool hdr, bool depth)

(Note: This won't work correctly for the deferred renderer, you'd need some post-process anti-aliasing there)

Oh, that does the trick:

image

Thank you, you're a genius. :)

With mips:
image