Created attachment 2062[details]
add r_ext_multisample
after much pestering from zakk:
patch to add r_ext_multisample to control FSAA. i'm not particularly happy with setting the variable permanently when falling back on a safer mode but anything better would probably require rewriting GLimp_StartDriverAndSetMode to take a fallback argument (and i've learned that i shouldn't write code after 10pm).
Comment 1Zachary J. Slater
2009-06-13 18:05:12 EDT
Just a cosmetic issue: You have messed up the comments for r_texturebits in tr_local.h (understandable after 10pm).
Also you might consider to turn multisampling off if the cvar is 1 (1x multisampling = no multisampling).
no graphics driver i've tested (nvidia and catalyst, mesa-based drivers won't let you enable fsaa) will accept values above 4, and r_ext_multisample 1 does in fact produce some smoothing, which leads me to believe that the value is the exponent (so r_ext_multisample 1 == 2**1 == 2x fsaa).
The extension spec says it is the number of samples, not the exponent. However there is a small difference between no multisampling and 1x multisampling, so it's better to leave it in.
(As I understand it no multisampling is required to always sample the center of the pixel, 1x multisampling may move the sample position within the pixel area. This can produce an AA effect if you average several frames with different sample position.)
Created attachment 2062 [details] add r_ext_multisample after much pestering from zakk: patch to add r_ext_multisample to control FSAA. i'm not particularly happy with setting the variable permanently when falling back on a safer mode but anything better would probably require rewriting GLimp_StartDriverAndSetMode to take a fallback argument (and i've learned that i shouldn't write code after 10pm).