antialiasing polygons
how would u go about adding multisample attributes to the NSOpenGLView? im really no good with pixel formats/buffers/etc at the moment, but could u just give me a brief rundown for future reference?
In your NSOpenGLView subclass implementation:
- (id)initWithFrame:(NSRect)frameRect{
GLuint attribs[]={NSOpenGLPFAAccelerated,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFANoRecovery,
NSOpenGLPFAColorSize,32,
NSOpenGLPFAAlphaSize,8,
NSOpenGLPFADepthSize,32,
/* this two attributes enable multisample on every primitive */
NSOpenGLPFASampleBuffers,1, // # of sample buffers
NSOpenGLPFASamples,4, // # of samples
0}
pixelFormat=[[NSOpenGLPixelFormat alloc]initWithAttributes:
(NSOpenGLPixelFormatAttribute*)attribs];
[[self openGLContext]makeCurrentContext];
return self;
}
- (id)initWithFrame:(NSRect)frameRect{
GLuint attribs[]={NSOpenGLPFAAccelerated,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFANoRecovery,
NSOpenGLPFAColorSize,32,
NSOpenGLPFAAlphaSize,8,
NSOpenGLPFADepthSize,32,
/* this two attributes enable multisample on every primitive */
NSOpenGLPFASampleBuffers,1, // # of sample buffers
NSOpenGLPFASamples,4, // # of samples
0}
pixelFormat=[[NSOpenGLPixelFormat alloc]initWithAttributes:
(NSOpenGLPixelFormatAttribute*)attribs];
[[self openGLContext]makeCurrentContext];
return self;
}
GL_RENDERER: Rage 128 OpenGL Engine
drew 231.2k polys per second @ 29.9 fps (gl backface cull)
drew 363.7k polys per second @ 30.3 fps (local backface cull + anti-alias)
drew 643.8k polys per second @ 29.7 fps (gl backface cull)
drew 370.6k polys per second @ 30.3 fps (local backface cull + anti-alias)
drew 618.3k polys per second @ 29.7 fps (gl backface cull)
drew 359.1k polys per second @ 30.0 fps (local backface cull + anti-alias)
drew 649.1k polys per second @ 29.9 fps (gl backface cull)
drew 187.9k polys per second @ 24.0 fps (local backface cull + anti-alias)(was doing weird stuff at the same time)
Hmm... this looks real weird(the data).
(This is one a g3 300)
Lets see what happens if I test it on my Voodoo5 card(with FSAA off, and on
)
drew 231.2k polys per second @ 29.9 fps (gl backface cull)
drew 363.7k polys per second @ 30.3 fps (local backface cull + anti-alias)
drew 643.8k polys per second @ 29.7 fps (gl backface cull)
drew 370.6k polys per second @ 30.3 fps (local backface cull + anti-alias)
drew 618.3k polys per second @ 29.7 fps (gl backface cull)
drew 359.1k polys per second @ 30.0 fps (local backface cull + anti-alias)
drew 649.1k polys per second @ 29.9 fps (gl backface cull)
drew 187.9k polys per second @ 24.0 fps (local backface cull + anti-alias)(was doing weird stuff at the same time)
Hmm... this looks real weird(the data).
(This is one a g3 300)
Lets see what happens if I test it on my Voodoo5 card(with FSAA off, and on

"Gameplay Uber Alles. And if you can make it psychedelic too, great!" - Jeff Minter
Quote:Originally posted by w_reade
hold on, memory (and ASP) tell me I've got a Rage 128 Pro, now I come to think of it. I've got a G4/400 too, so perhaps the "Rage 128" and "Rage 128 Pro" strings have got swapped somewhere? After all, you'd expect that the "Pro" one would be faster.
I like my machine a lot though - it may be a bit old now, but it stayed beefy for longer than any other machine I've had.
The Rage 128 Pro name I thought was just for marketing -- on iMacs the "Pro" meant 16MB vs 8MB, circa 2001 G3 iMacs. There was only one Rage 128 board that I know of -- I don't remember anything about upping the clock frequency. Maybe codemattic has something running in the background? Or a lot of windows open in the Finder -- Quartz Extreme uses OpenGL card memory whenever possible, so might cause some bus traffic and resultant slowdown.
While the following pixel format works well for fullscreen antialias on any Mac-PowerPC, it doesn't work well on a iMac Mac-Intel. The problems seems to come from these 2 lines:
NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)6,
With these two lines, I get garbage in the bottom area of the screen.
Without these 2 lines it works properly, but without antialias.
So, now, how can I get antialias in fullscreen on a Mac-Intel?
The machine is an iMac Mac-Intel with an ATI Radeon X1600 with 128 MB VRAM (120 MB are free). It supports 1 Samples Buffers, and it supports up to 6 samples. Anyway I tried to setup 2 or 4 or 6 samples and I get garbages all the time. When SampleBuffers is set to zero (no antialias) it works well.
I paste here the whole pixelFormat. Any idea?
NSOpenGLPixelFormatAttribute attrs[] = {
NSOpenGLPFAFullScreen,
NSOpenGLPFAAccelerated,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)32,
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)32,
NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute)8,
NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)4 ,
NSOpenGLPFAScreenMask, (NSOpenGLPixelFormatAttribute)
CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay),
(NSOpenGLPixelFormatAttribute)0
};
Regards
--
Lorenzo
archidea@mac.com
NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)6,
With these two lines, I get garbage in the bottom area of the screen.
Without these 2 lines it works properly, but without antialias.
So, now, how can I get antialias in fullscreen on a Mac-Intel?
The machine is an iMac Mac-Intel with an ATI Radeon X1600 with 128 MB VRAM (120 MB are free). It supports 1 Samples Buffers, and it supports up to 6 samples. Anyway I tried to setup 2 or 4 or 6 samples and I get garbages all the time. When SampleBuffers is set to zero (no antialias) it works well.
I paste here the whole pixelFormat. Any idea?
NSOpenGLPixelFormatAttribute attrs[] = {
NSOpenGLPFAFullScreen,
NSOpenGLPFAAccelerated,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)32,
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)32,
NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute)8,
NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)4 ,
NSOpenGLPFAScreenMask, (NSOpenGLPixelFormatAttribute)
CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay),
(NSOpenGLPixelFormatAttribute)0
};
Regards
--
Lorenzo
archidea@mac.com
You do realize that the post you are answering is more than three years old, right? 
For what is worth, (in response to the previous post) "Rage 128" and "Rage 128 Pro" are different.

For what is worth, (in response to the previous post) "Rage 128" and "Rage 128 Pro" are different.


With regards to FSAA not working, try adding NSOpenGLPFASampleAlpha followed by 1 in that that list. (in case it's confused about what kind of anti-aliasing to use when not specified on the Intel Macs.
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
SLOW performance drawing multiple polygons per frame with stencil buffer | clam61 | 7 | 10,615 |
Apr 27, 2013 11:53 AM Last Post: clam61 |
|
glCopyTexSubImage2D vs antialiasing on iPhone? | Mark Levin | 4 | 7,261 |
Jul 16, 2010 01:46 AM Last Post: Bersaelor |
|
Antialiasing and NSOpenGLView attributes | Jar445 | 2 | 8,240 |
Jan 20, 2009 10:42 AM Last Post: maximile |
|
n00b question: getting rid of lines along edges of polygons | Andrew | 2 | 4,060 |
Jun 5, 2005 05:57 PM Last Post: Andrew |
|
Depth Sorting Polygons | thaeez | 2 | 4,549 |
Aug 11, 2004 04:23 PM Last Post: thaeez |