Giter Site home page Giter Site logo

Comments (14)

flibitijibibo avatar flibitijibibo commented on August 23, 2024

If #11 is completed then this issue will be resolved, but only for Vulkan. OpenGL will unfortunately be out of luck due to the lack of proper support for disabling GL_MULTISAMPLE.

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

This could also be solved by #30, in theory.

from fna.

erodozer avatar erodozer commented on August 23, 2024

Just a suggested work around, do you think FNA could just get away with using a FXAA shader instead of GL_MULTISAMPLE? Using a simple shader for post processing and having it be built into FNA should be a feasible cross-platform solution.

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

FXAA isn't really the same, and it adds extra rendering passes behind the developer's back... it'd probably be easier to just get multisampling working with a different GLDevice!

from fna.

erodozer avatar erodozer commented on August 23, 2024

While it adds extra rendering passes, it's still typically less work than MSAA on the hardware and notably performs really well, even though the results aren't as great at lower resolutions.

I noticed you even have a gist for it with SpriteBatch.

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

That was part our original tests for enabling antialiasing in FEZ. Our conclusion was that it looked like total crap:

https://plus.google.com/+flibitijibibo/posts/48R4vB5MVPN

It didn't help that Tim Lottes even told us not to use it if we could avoid it...

Point is, I'm not writing it in and I don't suspect anyone else will either. Focus on Vulkan or Metal instead.

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

So while researching MultiSampleMask and glSampleMaski I ended up playing with the idea of setting GL_MULTISAMPLE to false and hoping that would work in combination with glSampleMaski(0, 1) or something to get "roughly" the same thing as if GL_MULTISAMPLE was actually respected.

I got to setting RasterizerState.MultiSampleAntiAlias = false and... uh, apparently it just works now??? WTF? Are there others that could possibly play with this? I swear when @renaudbedard and I were working on FEZ 1.12 it didn't work and there are discussions elsewhere talking about how drivers ignore it, and now I have it working with NVIDIA/Intel Linux and NVIDIA/Intel macOS. If any Windows users or AMD Linux users want to try this I made a super quick test binary:

http://www.flibitijibibo.com/msaaWTF.tar.bz2

Just run Program.exe (or ./Program on Linux/macOS) and toggle the multisample mode with the space bar. The demo is based on this example:

https://msdn.microsoft.com/en-us/library/bb975403.aspx

  • NVIDIA
    • Linux
    • macOS
    • Windows
  • Intel
    • Linux
    • macOS
    • Windows
  • AMD
    • Mesa (radeonsi)
    • Mesa (r600)
    • macOS
    • Windows

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

I now also have it verified as working on NVIDIA/Intel Windows. If this works on AMD I'm marking this as done and the drivers that don't support this will have to deal with it themselves...

I just updated msaaWTF with a corflags fix and Mac binaries; if you run AMD graphics on any platform please give that test project a try. Windows runs Program.exe and Linux/macOS runs ./Program.

from fna.

0x0ade avatar 0x0ade commented on August 23, 2024

Ran your test program on my machine. Windows 10, NVIDIA GTX 750 TI, dunno what driver version.

image

Edit: WTF, I just saw your "verified as working" comment. Time to update my drivers...

Edit: Updated drivers to the newest (388.31: 11/15/2017), same output and whoops, I somehow misunderstood this 😅

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

Possibly; my Windows machine tends to lag behind so there could be a newer release than what I tried. That said, looking at your output it appears to be working, the edges are aliased :P

from fna.

hoserama99 avatar hoserama99 commented on August 23, 2024

Works as expected on AMD Radeon 460, 10.13.1.

I'm not terribly surprised though - our ports have relied on this for years now. Hitman Absolution needed this to work, and it did as of when we shipped it back in 2014. (At least on macOS - can't speak to Linux.)

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

Thanks Brad! My guess is macOS has always respected it, though interestingly it's their docs specifically that informed this issue:

https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_fsaa/opengl_fsaa.html

The commands glEnable(GL_MULTISAMPLE) and glDisable(GL_MULTISAMPLE) are ignored on some hardware because some graphics cards have the feature enabled all the time. That doesn't mean that you should not call these commands because you'll certainly need them on hardware that doesn't ignore them.

I also got confirmation from a Windows AMD user via Twitter (thanks Joaquins Void!), so Linux is all that's left... I'm fine with just Mesa, don't care about fglrx or PRO.

from fna.

renaudbedard avatar renaudbedard commented on August 23, 2024

+1, works on Windows 10 & nVidia with latest drivers. I'm confused, but I'm glad!

from fna.

flibitijibibo avatar flibitijibibo commented on August 23, 2024

Got a radeonsi result from @kisak-valve so I'm calling this as done as can be. I updated the GL_MULTISAMPLE note accordingly:

c53a5e1

from fna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.