Antialiasing and NSOpenGLView attributes

Apprentice
Posts: 16
Joined: 2009.01
Post: #1
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).
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
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.
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #3
I've only ever made antialiasing to work by setting the pixel format attributes in code.

The relevant bits which work for me:

Code:
// in the pixel format attributes
    NSOpenGLPFASupersample,
    NSOpenGLPFASampleBuffers, 1,
    NSOpenGLPFASamples, 4,

// then later
    glEnable(GL_MULTISAMPLE);
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Nothing showing up in NSOpenGLView [newb] binaryinsomnia 6 6,308 Nov 29, 2011 07:04 PM
Last Post: binaryinsomnia
  glCopyTexSubImage2D vs antialiasing on iPhone? Mark Levin 4 4,694 Jul 16, 2010 01:46 AM
Last Post: Bersaelor
  Cocoa controls on top of NSOpenGLView wadesworld 5 5,809 Apr 6, 2009 01:38 AM
Last Post: arekkusu
  Adding NSOpenGLView class in Xcode/Interface Builder 3.0 Graphic Ace 2 3,669 Dec 5, 2007 02:15 PM
Last Post: Blacktiger
  Double-Buffering with NSOpenGLView DesertPenguin 3 5,650 Aug 1, 2006 07:17 AM
Last Post: DesertPenguin