-
Notifications
You must be signed in to change notification settings - Fork 69
Implement MSAA #1480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Implement MSAA #1480
Conversation
|
Nice! Finally some antialiasing! It looks like when MSAA is enabled the heathaze from back surface is applied on front surfaces too: |
|
My previous comment was about screenshots from the original post. When I try the branch and enable MSAA I get a black screen (AMD Radeon with Mesa radeonsi driver). |
That's interesting. Can you try with effects that use the main render target disabled, like heatHaze, bloom etc (or just use the lowest profile to make sure)? Also, does it work in the main menu? |
|
I get a completely black screen (other than 2D drawing) with |
|
Actually it's just black from whenever the 2nd map is loaded. Must be some cleanup bug |
|
Can this be rebased on current |
Done... but I haven't tested it after rebase, so I don't know if it still works lol. |
|
It looks like the rebase went wrong! 😅️ |
27484ca to
a80b19e
Compare
All fixed. |
The heatHaze is wrong because the heatHaze itself is drawn into the regular framebuffer, so this is an aliasing issue. It might be possible to make heatHaze render into an MSAA FBO, but I'm not sure it's worth the performance hit, since heatHaze with MSAA currently works as: To fix it, it would have to be: |
It's most likely that the driver is actually using a higher value. The spec says:
|
|
On my end it now works. I still get a black screen on AMD and Mesa when I use values higher than 8, but maybe we can cap that. |
Does it say in the log that the samples requested were too high and it's falling back on some other value? According to https://opengl.gpuinfo.org/displaycapability.php?name=GL_MAX_COLOR_TEXTURE_SAMPLES, 8 is indeed the max for AMD, but the renderer should be automatically using that value if you specify a higher one. |
After another |
|
We probably need something similar to this, but for // HACK: We want to set the current value, not the latched value
Cvar::ClearFlags("r_customwidth", CVAR_LATCH);
Cvar::ClearFlags("r_customheight", CVAR_LATCH);
Cvar_Set( "r_customwidth", va("%d", windowConfig.vidWidth ) );
Cvar_Set( "r_customheight", va("%d", windowConfig.vidHeight ) );
Cvar::AddFlags("r_customwidth", CVAR_LATCH);
Cvar::AddFlags("r_customheight", CVAR_LATCH); |
|
Ah, yes. I'll add that a bit later. |
Well that's only needed if you really want to use the cvar as a status display for the currently used value. Normally we try to avoid modifying cvars, and would store the current value in |
|
That's an option too. |
|
The |
That part is done now. |
|
There's a bug - dynamic lights are not rendered when MSAA is enabled. |
Fixed.
Also fixed now. |
Fixed this too. |
Add `r_msaa`. When set to > 0, an MSAA FBO will be created with that many samples. This FBO will be used for rendering, other than when it requires sampling from current render/depth image. When such rendering is required the MSAA FBO will be blit into the main FBO and vice versa, to resolve the MSAA texture.
|
Turning on |
|
Also color grading is missing in my tests so it's like the whole Besides that there are just a couple minor issues that I would consider non merge-blocking, at least if we call it an "experimental" feature: |










Implements #532.
Add
r_msaa. When set to > 0, an MSAA FBO will be created with that many samples. This FBO will be used for rendering, other than when it requires sampling from current render/depth image. When such rendering is required the MSAA FBO will be blit into the main FBO and vice versa, to resolve the MSAA texture.plat23:No MSAA:
MSAA 4x:
thunder:No MSAA:
MSAA 4x:
MSAA 16x:
MSAA 32x: