最近我尝试在 Linux 下使用 MSAA(多样本抗锯齿)。结果令人惊讶:对于 Nvidia 专有驱动程序,一切都像魅力一样工作,但是对于 nouveau 驱动程序,它不起作用。奇怪的是,glxingo 说支持 GLX_ARB_multisample 并且我能够在 GLX_SAMPLE_BUFFERS 设置为 1 和 GLX_SAMPLES 设置为 4(或 8)的情况下获得适当的 FBConfig。但是在渲染时,图片没有应用抗锯齿。我的项目和 freeglut 都存在这个问题,所以我将提供一个基于 glut 的小程序来演示这个问题:
/*
* Test multisampling and polygon smoothing.
*
* Brian Paul
* 4 November 2002
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
static GLfloat Zrot = 0;
static GLboolean Anim = GL_TRUE;
static GLboolean HaveMultisample = GL_TRUE;
static GLboolean DoMultisample = GL_TRUE;
static void
PrintString(const char *s)
{
while (*s) {
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); …Run Code Online (Sandbox Code Playgroud)