我有一个与ATI X1600显卡2007年Macbook专业。我正在尝试使用多采样特性来实现抗混叠工作。
使用GlView,这是我手头的信息:
渲染器信息是:
渲染器: ATI Radeon X1600 OpenGL Engine Vendor: ATI技术公司 内存: 128 MB 版本:2.1ATI-7.0.52 设备:MacBookPro2,2 2,2 着色语言版本: 1.20
我检查了arb_multisample的扩展信息,它说:“在OpenGL 1.3中升级到核心特性”,那么假设在我的代码中我可以简单地说(就像在OpenG2.1中那样)是正确的吗?
glEnable(GL_MULTISAMPLE)
在我的应用程序代码中,我有一个数据结构,它包含以下信息:顶点、索引和纹理,然后使用glDrawElements等进行渲染。所有这些都是三角形网格。
代码如下所示:
(capi:define-interface stad-viewer (capi:interface)
((double-buffered-p :initform t :initarg :double-buffered-p :accessor double-
buffered-p))
(:panes
(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))
(:layouts
(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)
opengl:*gl-unsigned-int*
gl-indices))))此外,我还启用了上述多重抽样。然而,这是我得到的
锯齿状的边缘清晰可见。
所以我的问题是:
发布于 2012-04-26 10:26:31
你在用可可NSOpenGLView吗?因为这样您就可以在Interface中启用多采样。在任何情况下,都必须使用示例缓冲区专门创建呈现上下文。无论如何,glEnable(GL_MULTISAMPLE)是不够的。为了获得更具体的帮助,您需要说明如何创建OpenGL窗口/视图。
https://stackoverflow.com/questions/10331316
复制相似问题