Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Antialiasing via conservative rasterisation and analytical area computation

NotificationsYou must be signed in to change notification settings

andrewlowndes/perfect-antialiasing

Repository files navigation

A new technique for rendering 3D triangles with 'perfect' anti-aliasing. Fonts and vectors are broken into triangles and rasterised conservatively then a fragment shader determines the triangle area coverage to compute the alpha for each fragment.

Process

GPU Rendering of vector graphics at a sub-pixel accuracy:

  1. Triangulate curves into triangles
  2. Render each triangle using conservative rasterisation
  3. For each fragment:
    1. Perform a triangle/box intersection, creating a polygon
    2. Sum the areas of the triangles in the polygon
    3. Divide the sum by the fragment area to give a percentage coverage
    4. Continue for all triangles, additively blending

Preview

Preview

Demos

Visithttps://andrewlowndes.github.io/perfect-antialiasing/dist/ to see a set of demos showing the various techniques used in this repo.

Run

  1. Ensure NodeJS installed
  2. Runnpm i to install dependencies
  3. Runnpm start to open the demos in a web app

Roadmap

  • CPU Demo (Canvas)
    • Cubic/quadratic bezier tesselation
    • Triangulate path to polygons
    • Conservative rasterisation
    • SVG test
    • Cell logic
    • Custom font rendering
  • WebGL
    • Conservative rasterisation (vertex-shader based shifting)
    • Custom font rendering
    • 3D Triangle
    • 3D scene
    • Screen-space tesselation
    • Instancing
    • Performance test
  • Vulkan
    • Screen-space tesselation via geometry shader
    • Conservative rasterisation using gpu extensions
    • Instancing
    • Performance test
  • Further experiments
    • Exact curve coverage analytics
      • Quadratic Bezier
      • Cubic Bezier (prob too complicated)

Usages

  • Anti-aliasing in games (need to assess overhead of conservative rasterisation and the alpha computation in the fragment shader)
  • Font rendering (still relies on triangulation - use screen-space in tesselation shader for resolution independent rendering)

Development

Install VS Code and the following extensions:

  • EditorConfig for VS Code
  • ESLint
  • Prettier

References

Vertex-based conservative rasterisation based off algorithm 2 from GPU Gems 2 Chapter 43 (https://developer.nvidia.com/gpugems/gpugems2/part-v-image-oriented-computing/chapter-42-conservative-rasterization)

About

Antialiasing via conservative rasterisation and analytical area computation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp