[2.1] AA not working

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


DOS
Gnoblar
Posts: 19
Joined: Tue Oct 27, 2020 5:34 pm

[2.1] AA not working

Post by DOS »

Hi!

I am trying to get some form of AA working for my render window, from what I've read it is supposed to work like this:

Code: Select all

Param["FSAA"] = "8";
auto Window = m_OgreRoot->createRenderWindow("PrimaryRenderWindow_", 800, 600, false, &Param);
However, everything looks just as jaggy as without FSAA:

Image

There is also no difference in FPS, but all the logs and debug values I have looked at lead me to believe FSAA is active, e.g. from the Ogre log:
15:57:35: D3D11: RenderSystem Option: Full Screen = No
15:57:35: D3D11: RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
15:57:35: D3D11: RenderSystem Option: sRGB Gamma Conversion = Yes
15:57:35: D3D11: RenderSystem Option: FSAA = 8

...

15:57:35: -------------------------
15:57:35: D3D11: Subsystem Initialising
15:57:35: D3D11: Driver Detection Starts
15:57:35: D3D11: "NVIDIA Quadro P2000"
15:57:35: D3D11: "Intel(R) HD Graphics 630"
15:57:35: D3D11: "Microsoft Basic Render Driver (software)"
15:57:35: D3D11: Driver Detection Ends
15:57:35: D3D11: Requested "(default)", selected "NVIDIA Quadro P2000"
15:57:35: ***************************************
15:57:35: *** D3D11: Subsystem Initialized OK ***
15:57:35: ***************************************
15:57:35: D3D11RenderSystem::_createRenderWindow "PrimaryRenderWindow_", 800x600 windowed miscParams: FSAA=8
15:57:35: D3D11: WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
15:57:35: D3D11: Created D3D11 Rendering Window 'PrimaryRenderWindow_' : 800x600, 32bpp
What's the problem?

Thanks.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5436
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1343

Re: [2.1] AA not working

Post by dark_sylinc »

The easiest way to troubleshoot this problem is to use RenderDoc.

RenderDoc will tell you:
  • If the render surface is actually 8xMSAA (look on the bottom)
  • Each subsample (on the top)
See on the top you can see the individual subsamples (samples [0; 3]) and their average result (i.e. what you should see on screen):
02.png
On the bottom you can see if it's actually MSAA. Look that it says 1600x720{4x 0Q}. The "{4x 0Q}" means it was 4x MSAA
01.png
Cheers

Update: A silly suggestion is that your GPU just happen to not actually support 8xMSAA, try 4 instead.
You do not have the required permissions to view the files attached to this post.
DOS
Gnoblar
Posts: 19
Joined: Tue Oct 27, 2020 5:34 pm

Re: [2.1] AA not working

Post by DOS »

So MSAA does not seem to be supported by my gpu but FSAA is.

Looking at render doc and using

Code: Select all

Param["FSAA"] = "4";
I see the {4x 0Q} just like in your screenshot, but all samples 0 - 3 look exactly the same (jaggy) and so the average also looks the same. The aliasing is just as bad as without FSAA.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5436
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1343

Re: [2.1] AA not working

Post by dark_sylinc »

Can you upload the capture? I want to confirm something, because from what it sounds, it sounds like a driver bug
DOS
Gnoblar
Posts: 19
Joined: Tue Oct 27, 2020 5:34 pm

Re: [2.1] AA not working

Post by DOS »

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5436
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1343

Re: [2.1] AA not working

Post by dark_sylinc »

Hi!

I can see AA is working correctly.

However there is a draw quad pass that is dropping the MSAA result.

You can see the rendering is correctly AA up until this point:



But then there is a quad pass at EID 1863 that samples from the MSAA surface directly (instead of sampling from the resolved target) and that's how you drop the MSAA (and this eventually ends up in the screen).



I can't see the pixel shader's source code, it's only compiled byte code; thus I guess it's proprietary code. Without looking at either Compositor script and/or the pixel shader I can't know further.

It would appear you're using explicit_resolve (which shouldn't be used in this case) or your pixel shader is screwing up (by asking for an MSAA texture which does indeed need explicit_resolve but then only reading one subsample).

Cheers
DOS
Gnoblar
Posts: 19
Joined: Tue Oct 27, 2020 5:34 pm

Re: [2.1] AA not working

Post by DOS »

Thanks! explicit_resolve in the compositor was the problem.