Take the 2-minute tour ×

I have a 2007 Macbook pro with ATI radeon X1600 graphics card. I am trying to get anti aliasing working using multisampling feature.

Using GlView , this is the information that I have at hand:

The renderer information is:

Renderer: ATI Radeon X1600 OpenGL Engine Vendor: ATI Technologies Inc. Memory: 128 MB Version: 2.1 ATI-7.0.52 Device: MacBookPro2,2 Shading language version: 1.20 

I checked the extension information for the arb_multisample and it says: "Promoted to core feature in OpenGL 1.3", is it then correct to assume that in my code I can simply say (as I am on Opengl 2.1):


In my application code, I have a data structure, which has the following information: vertices, indices and textures which I then render using glDrawElements etc. Also all are triangular meshes.

The code looks something like this:

    (capi:define-interface stad-viewer (capi:interface)
      ((double-buffered-p :initform t :initarg :double-buffered-p :accessor double-
         (canvas opengl:opengl-pane
              :configuration (list :rgba t :depth t :depth-buffer 32 :double-buffered t)
              :min-width 1440 
              :min-height 900 
              :message "Stadium demo"
              :drawing-mode :quality
              :reader canvas
              :resize-callback 'resize-stad-canvas
              :display-callback 'redisplay-stad-canvas))
         (main capi:column-layout '(canvas)))
      (:default-initargs :auto-menus NIL :title "Stadium Viewer"))    

;;; enable multisampling
(opengl:gl-enable opengl:*gl-multisample*)
(opengl:gl-sample-coverage 0.70 opengl:*gl-false*)

;;; some more opengl commands....

;;; rendering meshes
(dolist (wfmesh *wfmeshes*)
   (format t " ------ PREPARING MESH ---- ~A ~% " (mesh-name wfmesh))
   (multiple-value-bind (vertices indices)
        (prepare-mesh wfmesh)
      (let* ((gl-vertices (gl-vertexes vertices))
             (gl-indices (gl-indexes indices)))
        (if *texture-ids*
          (multiple-value-bind (texture-id found)
                    (gethash (mesh-name wfmesh) *texture-ids*)
             (when found
                (opengl:gl-bind-texture opengl:*gl-texture-2d* texture-id)
                (opengl:gl-tex-coord-pointer 2 opengl:*gl-float* 0 
                                                   (gl-texels (mesh-vertices wfmesh)   
                                                        1.0 t)))))      
        (opengl:gl-vertex-pointer 3 opengl:*gl-float* 0 gl-vertices)
        (opengl:gl-draw-elements opengl:*gl-triangles* 
                                   (length indices) 

Also I have enabled multisampling as above. However this is what I get:

The jagged edges are clearly visible.

So my questions are:

  1. Is my understanding that multisampling is a core feature correct?
  2. Does just enabling multisampling and calling drawing code work or some more steps are required to get multisampling working?
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Are you using a Cocoa NSOpenGLView? Because then you can just enable multisampling in Interface Builder. In any case, you must create your render context specifically with sample buffers. In any case, glEnable(GL_MULTISAMPLE) is not enough. In order to get more specific help, you need to state how you create your OpenGL window / view.

share|improve this answer
Actually I am using Lispworks with their ffi interface to opengl. Lispworks GUI toolkit (CAPI) has a specific opengl pane. So from what you mention, I figure that I have to find out how to create the opengl context with the sample buffers. –  dmsurti Apr 26 '12 at 12:28
Updated the question with actual code. the capi-define-interface part is where the window with opengl pane is created. rest is what is enabling multisampling and then the rendering of meshes. Sorry I did not post actual code and provide the fact that I use lisp. –  dmsurti Apr 26 '12 at 12:40
I don't know lisp or Lispworks, but I think you'll have to add more parameters to your configuration list when creating the OpenGL pane. Under the hood, it all depends on selecting an appropriate pixel format that supports multisampling. This example is for Windows, but it explains how multisampling depends on the pixel format. –  Kristian Duske Apr 26 '12 at 13:11
FIXED. Thank you @Kristian. I had to pass NSOpenGLPFASampleBuffers and NSOpenGLPFASamples. Now no jagged edges. –  dmsurti Apr 26 '12 at 13:25
add comment

Your Answer


