Antialiasing and NSOpenGLView attributes
I'm trying to enable full screen antialiasing in my NSOpenGLView subclass. I call glEnable(GL_MULTISAMPLE) in my prepareOpenGL, while in Interface Builder I've tried setting Sampling to 1 or 2 and setting the antialiasing to either Default or Multisampling. I still see jagged edges on my polygons, and my application crashes when I try to quit and have the antialiasing set to Multisampling (if I use the default renderer; using the accelerated renderer with multisampling gives me a white screen).
Now, I'm also using a fragment shader with this. Could this possibly be blocking the multisampling. Also, would it be better to do the antialiasing by performing blurring in the fragment shader anyway?
Also, is it better to set the attributes of an NSOpenGLView in Interface Builder or programatically? Setting them in Interface Builder is easier, but there are a couple of attributes that I don't really understand and haven't found real documentation for. I'd also have to set the attributes in IB over and over again if I use the NSOpenGLView in more than one application (like the depth buffer).
Now, I'm also using a fragment shader with this. Could this possibly be blocking the multisampling. Also, would it be better to do the antialiasing by performing blurring in the fragment shader anyway?
Also, is it better to set the attributes of an NSOpenGLView in Interface Builder or programatically? Setting them in Interface Builder is easier, but there are a couple of attributes that I don't really understand and haven't found real documentation for. I'd also have to set the attributes in IB over and over again if I use the NSOpenGLView in more than one application (like the depth buffer).
IB's NSOpenGLView inspector has a bug, and does not set the multisample pixel format attributes correctly. This has already been fixed for a future release.
You'll have to create the pixel format programatically to work around this.
You'll have to create the pixel format programatically to work around this.
I've only ever made antialiasing to work by setting the pixel format attributes in code.
The relevant bits which work for me:
The relevant bits which work for me:
Code:
// in the pixel format attributes
NSOpenGLPFASupersample,
NSOpenGLPFASampleBuffers, 1,
NSOpenGLPFASamples, 4,
// then later
glEnable(GL_MULTISAMPLE);
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Nothing showing up in NSOpenGLView [newb] | binaryinsomnia | 6 | 4,891 |
Nov 29, 2011 07:04 PM Last Post: binaryinsomnia |
|
| glCopyTexSubImage2D vs antialiasing on iPhone? | Mark Levin | 4 | 3,934 |
Jul 16, 2010 01:46 AM Last Post: Bersaelor |
|
| Cocoa controls on top of NSOpenGLView | wadesworld | 5 | 5,070 |
Apr 6, 2009 01:38 AM Last Post: arekkusu |
|
| Double-Buffering with NSOpenGLView | DesertPenguin | 3 | 4,797 |
Aug 1, 2006 07:17 AM Last Post: DesertPenguin |
|
| antialiasing polygons | honkFactory | 37 | 14,275 |
Apr 3, 2006 09:19 AM Last Post: akb825 |
|

