Git Product home page Git Product logo

Comments (8)

renaudbedard avatar renaudbedard commented on July 23, 2024

I tried doing similar handing as the scissor test locally, in ApplyRasterizerState :

if (rasterizerState.MultiSampleAntiAlias != multisamplingEnable)
{
     multisamplingEnable = rasterizerState.MultiSampleAntiAlias;
     ToggleGLState(GLenum.GL_MULTISAMPLE, multisamplingEnable);
}

...which should work, and doesn't crash or anything, but it has no effect on my end. Could be my usage of it though?

Edit : Maybe related to this : https://www.opengl.org/discussion_boards/showthread.php/172025-glDisable(GL_MULTISAMPLE)-has-no-effect

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 23, 2024

For whatever reason GL_MULTISAMPLE is a best a hint and at worst a complete waste of time depending on what driver and hardware you're using. We're both on NVIDIA hardware which completely ignores this value.

I looked into items that are related to this (glSampleCoverage and its related enable/disable enums), but it seems like it really is down to the FBO attachments.

The only obvious way we can resolve this is to actually use the texture instead of the renderbuffer that is part of the RenderTarget object; since RasterizerState is checked every draw, we could try to find a way to verify the attachments when RasterizerState.MultiSampleAntiAlias is toggled, and attach the right item at SetRenderTargets() depending on the current RasterizerState. But, keep in mind that we would still need to resolve what's on the renderbuffer, so you'd have to deal with merging the antialiased with the aliased. This could mean not only resolving from the renderbuffer to the texture, but also from the texture to the renderbuffer should the game decide to go back-and-forth before finally unsetting the target. glBlitFramebuffer's kinda cheap, but that many blits can add up fast.

I'm not sure who decided that an essential GLenum wasn't worth actually following, but hopefully they don't work anywhere important anymore.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 23, 2024

Something else to consider is just reallocating the renderbuffer storage to not be multisampled when multisampling is disabled, but A: I don't want to think how slow that'd be to resolve and reallocate for each change, and B: I dunno if the driver would be smart enough to handle the data being realloc'd for the current attachment handle.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 23, 2024

For completion reasons I've at least added the GL toggle to the OpenGLDevice...

54dc08f

... so at least this way it is 100% the vendors' fault and not ours. I'd like a real solution though.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 23, 2024

Oh god I just thought of something really stupid.

If you can find a game on Windows that used glDisable(GL_MULTISAMPLE) for their MSAA support, you might be able to rename the executable to that of the game, and it'll actually work like it's supposed to.

Maybe doom3.exe can save us yet again? EDIT: Well, not Doom 3 anyway. Checked the GPL release and it's not there.

from fna-mghistory.

sulix avatar sulix commented on July 23, 2024

Have you set the SDL_GL_MULTISAMPLE{BUFFERS,SAMPLES} attributes before creating the context? Not that I can think of any time that's actually worked, but maybe you'll be lucky.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 23, 2024

We actually don't use the backbuffer for any multisampling; all of that rendering is done exclusively with renderbuffers either in the RenderTarget or in the faux-backbuffer.

The funny thing is that it has the exact opposite problem as the real backbuffer in that it's almost impossible to disable multisampling, whereas the backbuffer requires voodoo magic to enable at context creation (as you pointed out).

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 23, 2024

This issue has been discontinued in favor of the new repository:

FNA-XNA/FNA#3

from fna-mghistory.

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.