简体   繁体   English

使用GL_TRIANGLE_FAN进行抗锯齿

[英]Anti-aliasing with GL_TRIANGLE_FAN

I'm not getting any anti-aliasing when using drawing GL_TRIANGLE_FANs with this code: 使用带有以下代码的绘图GL_TRIANGLE_FAN时,我没有得到任何抗锯齿功能:

  glDisable(GL_DEPTH_TEST);

  // Blended points, lines, and polygons.
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

  glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
  glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
  glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);

  glEnable(GL_POINT_SMOOTH);
  glEnable(GL_LINE_SMOOTH);
  glEnable(GL_POLYGON_SMOOTH);

What am I doing wrong? 我究竟做错了什么?

Edge antialiasing is always a hint, the implementation (you don't specify which) is free to ignore it per the spec. 边缘抗锯齿始终是一个提示,根据规范,实现(您无需指定哪个)可以随意忽略它。 For various reasons (eg the inability to handle intersecting polygons, bad interactions with framebuffer blending) this sort of antialiasing has fallen out of favor and been replaced by multisample-based algorithms that work at the framebuffer level. 由于各种原因(例如,无法处理相交的多边形,与帧缓冲区混合的不良交互),这种抗锯齿功能已不受欢迎,并被在帧缓冲区级别工作的基于多样本的算法所取代。 There is an ARB multisample extension to control this (I believe it's default in recent versions of the spec, actually). 有一个ARB多样本扩展来控制此操作(实际上,我认为它是该规范的最新版本中的默认设置)。 Or often the drivers have ways to enable it globally without source code modification. 或者通常,驱动程序有办法在不修改源代码的情况下全局启用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM