Antialiasing and NSOpenGLView attributes

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
Posts: 1,234
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
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:

// in the pixel format attributes
    NSOpenGLPFASampleBuffers, 1,
    NSOpenGLPFASamples, 4,

// then later
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Deprecated attributes VanceRegnet 4 4,931 Dec 9, 2014 03:04 PM
Last Post: arekkusu
  Nothing showing up in NSOpenGLView [newb] binaryinsomnia 6 10,717 Nov 29, 2011 07:04 PM
Last Post: binaryinsomnia
  glCopyTexSubImage2D vs antialiasing on iPhone? Mark Levin 4 7,659 Jul 16, 2010 01:46 AM
Last Post: Bersaelor
  Cocoa controls on top of NSOpenGLView wadesworld 5 8,520 Apr 6, 2009 01:38 AM
Last Post: arekkusu
  Adding NSOpenGLView class in Xcode/Interface Builder 3.0 Graphic Ace 2 5,383 Dec 5, 2007 02:15 PM
Last Post: Blacktiger