puklaus's picture

List of FSAA levels

Project:The Open Toolkit library
Version:1.1-2014-01-02
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Method that returns available list of supported FSAA levels, so can list them to menu.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
JTalton's picture

#1

I was having problems getting FSAA working. It came down to that I was requesting a 32-bit depth buffer and that was causing it not to use FSAA. GraphicsMode(32, 32, 0, 4)
Once I moved to a 24-bit depth, it works good. GraphicsMode(32, 24, 0, 4)

I then wanted to enumerate what sampling modes the video card supported so I did:

foreach (int samplecount in new int[] { 0, 2, 4, 6, 8, 16, 32, 48, 64 })
{
    Console.WriteLine(new GraphicsMode(32, 24, 0, samplecount).Samples);
}

It writes out 0, 2, 4, 6, 8, 16, 32, 48, 64 which does not seem right as it does not do all those modes.

I know internally that OpenTK can enumerate all the GraphicsModes that are supported. Is there any way we can expose that list?

the Fiddler's picture

#2

I've fixed the bug that caused GraphicsMode to return incorrect results to your code (simple lazy evaluation gone awry): r2654 of 1.0 branch (or wait for 1.0 rc2).

Quote:

I know internally that OpenTK can enumerate all the GraphicsModes that are supported. Is there any way we can expose that list?

That would be too easy. :-)

No, OpenTK doesn't enumerate all GraphicsModes internally. It queries the driver and returns the closest match directly.

Getting such a list would require a non-trivial rewrite of the relevant code, plus an amount of duplicated logic (we'd have to find the best match ourselves instead of relying on the driver). I plan to do this eventually, but this is one of those features that don't fare very well in the "implementation difficulty versus value" scale.

the Fiddler's picture

#3

Version:1.x-dev» 1.1-2014-01-02
Status:open» closed

While it is possible, in theory, to enumerate all available GraphicsModes, doing so requires non-trivial amounts of code. Indeed, no toolkit offers this information (SDL, SDL2, GLFW or GLUT).

Since OpenTK 1.1-beta4, we have a better solution in place: simply request the FSAA mode you wish in the GraphicsMode constructor, and OpenTK will automatically choose the closest supported mode (which may be 0 if FSAA is not supported at all.)