Skip to content

Commit

Permalink
Deploying to gh-pages from @ 268c290 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Sep 23, 2024
1 parent 088fffd commit 2c77536
Show file tree
Hide file tree
Showing 8 changed files with 327 additions and 129 deletions.
17 changes: 16 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,22 @@ var aBuffer = {

var alphaToCoverage = {
name: 'Alpha-to-Coverage',
description: 'Visualizes how alpha-to-coverage translates alpha values into sample coverage on your device. This varies per device; for example, not all devices guarantee that once a sample pops in, it will stay; some devices repeat at 2x2 pixels, others at 4x4; etc. The circles show the 4 samples of each pixel; the background checkerboard shows where the pixels are.',
description: `
Alpha-to-coverage is an alternative to alpha testing and alpha blending. See:
<https://bgolus.medium.com/anti-aliased-alpha-test-the-esoteric-alpha-to-coverage-8b177335ae4f>

This sample visualizes how alpha-to-coverage translates alpha values into sample
coverage on your device. It draws two full-screen quads into a 4-sample
texture, each with the configured color and alpha value. Then, it visualizes the
contents of the resulting 4-sample texture: the circles show the 4 samples of
each texel; the background shows the "resolved" results (average of 4 samples).

The algorithm that converts alpha to a coverage sample mask varies per device.
This results in different average "blending" proportions between the black
background, the first draw, and the second draw.
Device differences include different tile sizes (e.g. 1x1, 2x2, or 4x4),
"moving" samples (or not) around with in the tile as alpha increases, etc.
`,
filename: "sample/alphaToCoverage",
sources: [
{ path: 'main.ts' },
Expand Down
2 changes: 1 addition & 1 deletion main.js.map

Large diffs are not rendered by default.

203 changes: 143 additions & 60 deletions sample/alphaToCoverage/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sample/alphaToCoverage/main.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 2c77536

Please sign in to comment.