yquake2 / yquake2

The Yamagi Quake II client
https://www.yamagi.org/quake2/
Other
841 stars 215 forks source link

nvidia-settings seems to have no impact on yquake2 (linux) #171

Closed volumetricsteve closed 7 years ago

volumetricsteve commented 7 years ago

This probably on the long list of things you're not worried about, but I'm trying to see if I can get yquake2 to do FSAA instead of MSAA. I figured if I go into nvidia-settings and set all of the "override application settings" and "force" things on, it shouldn't matter what yquake2 is set to. It would appear that those options have no impact at all on yquake2 and yquake2 does what it wants. If I want FSAA, am I going to have to fork yquake2 and do horrible things to it?

Edit: I mean to say I want super sampling instead of multi sampling.

Edit edit:

I may have just fixed this...apparently setting nvidia-settings from the command line is somehow more effective than doing it with the GUI? Testing...

DanielGibson commented 7 years ago

Isn't MSAA a form of supersampling? Why do you want something else? Does forcing via driver also not work when disabling MSAA in YQ2?

Also, if the driver claims to be able to force it and fails to do so, that's a bug in the driver and not in YQ2 :-P

volumetricsteve commented 7 years ago

MSAA (I think) detects the edges of polygons and does the AA routine to those pixels. Super sampling x2 (for example) should be rendering a 1024x768 display at 2048x1536 and then it downsamples that image to fit 1024x768, so every pixel is handled, not just the edges.

I want something else because I'm a nut, and I know this about myself. :D

I tried disabling MSAA in YQ2 to no avail, not sure what's going on there.

On your final point you are correct, but I wondered if you good people might find it in your hearts to implement SSAA along-side MSAA, I can't imagine it'd be too different from how MSAA is already implemented. If not...I might be out of my mind enough to fork it and take a stab at it myself.

I like the stance Yamagi and (I assume you) take on not adding a bunch of graphical thingies like Q2Evolved did, et al. I like that Yamagi Quake2 looks pure, clean, and uncluttered without a million amateur pixel shaders erratically murdering performance. I like SSAA, because the argument ATI made back in the day was, the final image was the direct result of taking a bigger data set (the higher res rendering) and down-sampling to arrive at the final image, which pulls in every pixel, therefore resulting in a higher quality image than a partial technique like MSAA. It's 110% splitting hairs in a case like this, but philosophically I agree with ATI.

DanielGibson commented 7 years ago

I'm not sure how one does SSAA with OpenGL. MSAA is very simple for us: We just have to call SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); and SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); (for 4x AA) before creating the OpenGL context and we're done - there is no similar attribute for SSAA.

Furthermore, I really doubt that you'd get any noticeable image improvement with SSAA - do you really get noticeable alialising with 4x MSAA? As the textures themselves are pretty blurry when you're near, I somehow doubt that (and I think it's mostly a problem with textures with "holes", like grates you can see through, but Q2 doesn't use those much).

volumetricsteve commented 7 years ago

I've just discovered that the nvidia driver acts a little weird. You have to manually invoke the driver to load previously stored settings - so that was half of my problem.

If you're looking for it, you can tell almost immediately if you're on MSAA or SSAA. It's like the poster-child for things that aren't a big deal, but if it's a sufficiently low hanging fruit, I'll try and get it working.

I should also mention that I've got GL_NEAREST_MIPMAP_LINEAR because what I like to do is turn off all of the texture filtering and then ramp up the AA so that the edges of pixels within textures look a certain way. I know full well how insane this sounds - I admit I am deserved of all judgement I get for it.

I can do this at the driver level, at least I've successfully got yq2 open with the driver doing everything on the back end to handle the 4xSS, but the hurdle I'm at now is getting it to work without a window manager and getting nvidia-settings to load with something else is tricky.

Anyway, no worries, thanks for hearing out my insanity.

DanielGibson commented 7 years ago

nvidia-persistenced might be what you're looking for. I think you can run that in the background to make sure your nvidia-settings settings are used.

volumetricsteve commented 7 years ago

super cool, i'll try that. nvidia-settings --load-config-only & seems like it should work...but xinit doesn't like it, hopefully nvidia-persistenced cooperates.

DanielGibson commented 7 years ago

I'm also curious to see screenshots comparing the AA modes :)

volumetricsteve commented 7 years ago

I'd be happy to oblige...and I realize in this instant I've never needed to take a screenshot in linux before..and I have no idea how I'd even do it without a window manager. Lemme get back to you on that.

DanielGibson commented 7 years ago

luckily quake2 supports taking a screenshot out of the box ;)

in the console you can enter bind F12 screenshot and afterwards you can take screenshots by pressing F12. They'll be saved as .tga in $HOME/.yq2/baseq2/scrnshot/

volumetricsteve commented 7 years ago

Well that's convenient! I should have known... .tga will be perfect too in order to catch all the subtle nuance. Once I get home I'll fire that up. Unrelated, I submitted a bug report for that branch of IceWM you suggested to me, the dev supposedly fixed the bug, so I'll try that again which should be a pretty final solution to my other thread.

volumetricsteve commented 7 years ago

The new IceWM finally works...kind of ...I have more bugs to report, but it works, ioquake3 works, I can rocket jump, all is well there. Quake 2 also works. So I'll post a link or something once all the bugs get ironed out, or the big ones anyway.

As for the matter of SSAA vs MSAA, the best I can do is a combination due to limits in the nvidia driver, but here I contrast no FSAA of any kind vs FSAA (mode 11) which is 4xSSAA+4xMSAA, I'm not sure which it does first, but the important part remains that the whole screen gets handled, not just edges.

http://imgur.com/a/doO4u

You'll want to zoom in on each one to see the finer differences. I'm hoping to get my hands on either A: a different nvidia card which can do pure SSAA, or B: a modern AMD card I can do SSAA with...

To me, the real cool thing about this tech is that when you're running and gunning, everything looks really nice anyway, but when you stop to look around, each thing you focus on looks like a render they'd use for the box art, which is probably accurate since iD used a lot of workstation graphics cards in their day and those did a lot of SSAA. If memory serves, MSAA was a more recent tech (recent as of...1994?) and was meant to be a quick hack approach to FSAA that made it more feasible for games. Prior to that, SSAA was just how it was done because it was the simplest to implement code-wise, and probably silicon-wise since it's just rendering a huge image and shrinking an image in vram...it just needed serious bandwidth, which was provided almost exclusively by workstation-type video cards of the time.

Based on this, it looks like MSAA was brought to us by SGI in 1994:

"SGIS_Multisample Specification Date: 1994/11/22 Revision: 1.14"

It was made available in OpenGL in either 1999 or 2002, i'm not sure, but take a look at this:

https://www.opengl.org/registry/specs/ARB/multisample.txt

Anyway....there's all that.

DanielGibson commented 7 years ago

Sorry, I fail to see any difference (apart from slightly different viewing angle which has nothing to do with AA). I compared pixels on the textures (in the middle of faces, not just edges) and they looked identical.

"recent as of...1994?" yeah, Q2 was released in 1997, so if their graphics cards had any AA at all, it might as well have been MSAA. Maybe GL_ARB_multisample is from 1999, but it's just a variation (possibly slightly improved) of GL_SGIS_Multisample from 1994, so OpenGL supported multisampling from 1994 on, if the hardware (and driver) supported that extension. I kinda doubt hardware back then (even workstation hardware) was able to do SSAA with Q2.

volumetricsteve commented 7 years ago

Did you zoom in on the images? i realized when I uploaded them that..the exact process that SSAA does is being done to resize the images to downscale them to the size they normally appear at, until they're expanded.

It's hard to find anything readily about the history of anti-aliasing in general, least of all super sampling....I'm all but certain that AA was just SSAA until MSAA...but I can't find much to support either belief that one came before the other.

I did find this: http://www.dtic.mil/dtic/tr/fulltext/u2/a236631.pdf

Which discusses SSAA as early as 1991, which predates any MSAA article I can find...but that doesn't necessarily mean that SSAA is older.

I can say I know with certainty I had SSAA on my Radeon X800 pro, though that was 2004.

It's not a peer reviewed article or anything, but this seems to indicate that I'm just crazy and I've got my technologies and years all screwed up, which is entirely possible: http://arstechnica.com/civis/viewtopic.php?f=6&t=48892

I'll try to dig up more hard factual sources, but i'm not having a ton of luck....it seems like FSAA just popped into being around the early 90s-ish. shrug

If you can't see the difference, I'm not surprised, it's pretty subtle...but I love it....I can't help my own crazy.

Edit:

Now i'm too curious for my own good and I'm going to call the university of north carolina at chapel hill tomorrow, see what I can dig up.

maraakate commented 7 years ago

Man, you'd probably have a heart attack knowing that I'm typing this from a 23" Hitachi CRT and that my main TV in the house is a 30" RCA Console and I mostly watch LaserDisc movies on it and that it's old enough that the comb filter on the LaserDisc player is better than the TV so it's in my interest to use S-Video over Composite/RCA.

maraakate commented 7 years ago

With that said, I also don't even bother with AA in any game, ever. Even Quake 2. Maybe I'm just used to AA being so shitty in the late 90-to-mid-2000s with it's performance hit that I'd rather run the game at 1280x1024 instead of 800x600 @ 4xAA (whatever the mode I don't know the specific ones anymore).

volumetricsteve commented 7 years ago

I bet that CRT is awesome though. The rest of that is...rough on my blood pressure, but I respect your dedication to you doing you. thumbs up For a lot of people AA doesn't even begin to matter, which is cool, I just think the technology itself is awesome and I love seeing processing power, well-done, in action. Something about it feels weirdly luxurious to me. You're right though, AA on late 90s hardware was ROUGH on the hardware of the time and it was a constant trade off between masking jaggies and trying to keep above 40fps...

maraakate commented 7 years ago

The problem I have is that there is a difference in your screenshots but it's almost so minute that even stopping to look you'd almost barely notice it. For fun, I just tested the game at 8xAA settings override in the nvidia control panel @ 1856x1392@72hz (very weirdo res! use it for my desktop res) and it still manages to chug 1000fps (max capped hard limit) in Quake 2. So at least now it's a viable technology.

Either way though, I'd rather run at 1024x768@140hz. The mouse movement is so buttery smooth at that refresh rate on this monitor. Sometimes I'll do 1280x1024@120hz on some newer titles.

Slightly off-topic, but if you find the magic of SGI interesting look up Fast Inverse Square Root. It's rumoured to have come from the hands of SGI employees in one way or another.

volumetricsteve commented 7 years ago

1856x1392@72hz

Why? What happened to make your desktop this way?

140hz sounds incredible, but on my laptop....I'm pretty much stuck at 59hz, so I'm burning gpu cycles on nothing if I'm not throwing AA at it.

I'll take a look at Fast Inverse Square Root.

maraakate commented 7 years ago

What do you mean what happened? I do dev work with the YQ2 guys on Daikatana 1.3 and my own projects and having large screenspace for the IDE is a huge plus for me.

I got this monitor (and several others that are 21"s) from a guy who was the IT manager for an Architect firm. They required high quality CRTs for their CADD work. I told him years ago, if you ever decide to get rid of any of this stuff let me know. Finally, they decided to switch to LCDs and he gave me a call on a Friday afternoon saying whatever I wanted take it but anything left there after Sunday will be recycled.

volumetricsteve commented 7 years ago

Oh no, I understand all that, but why that resolution as opposed to 1600x1200 or...something else....or is that the native resolution of your display?

maraakate commented 7 years ago

It's the highest resolution it goes to and I find it to be a very enjoyable resolution when I'm on the desktop.

I don't really use 1600x1200 at all; except maybe like STALKER or some game like that. I don't really care for the older titles that having scaling. Unless the artwork is done well to scale well it just ends up looking very blurred when scaled (to me personally). So the CRT comes in handy that lower resolution still looks good at something like 1024x768. I don't hate LCDs, I have plenty of laptops, but I really don't like how they look terrible in their non-native res. The other complaints from 10-15 years ago of the black levels, ghosting, colour reproduction and sharpness have seem to be a thing of the past for LCDs. That's a good thing, but the whole non-native res thing still agitates me. But, who is playing SVGA games on LCDs any more? :)

shoober420 commented 7 years ago

I'm with maraakate. I use a IBM P275 CRT to this day. I still believe CRTs are superior to LCD. I play CS1.6 at 640x480@170Hz. It feels amazing. I don't use AA in any games. I've been tempted in some recent titles, but I play modern games at 2048x1536, so jaggies aren't unbearable. I do play quake 2 single player at 2048x1536, but if I'm doing some railing on tastyspleen, I'm back to 640x480@170Hz. I find the jaggies make it easier to spot players and lower resolution makes the models appear bigger.

I respect that you use no texture filtering in quake 2 though volumetricsteve. That's how I play Quake 1, using GL_NEAREST_MIPMAP_NEAREST.

volumetricsteve commented 7 years ago

fist bump GL_NEAREST_MIPMAP_NEAREST solidarity.

I used to have a set of GREAT Dell flat CRTs : http://i.ebayimg.com/00/s/NTkzWDgwMA==/z/wp4AAOSwubRXG4Fy/$_35.JPG

I should never have given them up.

DanielGibson commented 7 years ago

As there seems to be no easy way to support SSAA directly in Yamagi Quake II and the problem was due to nvidia-settings (or nvidia-persistanced) not running and it now works for you, I think this can be closed.

volumetricsteve commented 7 years ago

Absolutely, thank you.

Side note, since I work in a building full of people with PhDs in various kinds of computer engineering, a visualization guy I work with is bringing in some books that should clear up the true history of Anti-Aliasing.