Skip to content

Commit

Permalink
Deploying to gh-pages from @ e2c78be 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Nov 19, 2024
1 parent dd9da83 commit 6acd373
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 3,350 deletions.
37 changes: 11 additions & 26 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,15 @@ var aBuffer = {
],
};

var alphaToCoverage = {
name: 'Alpha-to-Coverage',
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' },
{ path: './renderWithAlphaToCoverage.wgsl' },
{ path: './showMultisampleTexture.wgsl' },
],
var alphaToCoverageEmulator = {
name: 'Alpha-to-Coverage Inspector/Emulator',
description: '',
filename: "sample/alphaToCoverageEmulator",
external: {
url: 'https://kai.graphics/alpha-to-coverage-emulator/',
sourceURL: 'https://github.com/kainino0x/alpha-to-coverage-emulator',
},
sources: [],
};

var animometer = {
Expand Down Expand Up @@ -681,7 +666,6 @@ const pageCategories = [
renderBundles,
occlusionQuery,
samplerParameters,
alphaToCoverage,
timestampQuery,
},
},
Expand Down Expand Up @@ -745,6 +729,7 @@ const pageCategories = [
clusteredShading,
spookyball,
marchingCubes,
alphaToCoverageEmulator,
},
},
// Samples whose primary purpose is to benchmark WebGPU performance.
Expand Down Expand Up @@ -33443,7 +33428,7 @@ function setSampleIFrame(sampleInfo, search = '') {
sampleContainerElem.innerHTML = '';
if (filename) {
const src = external ? external.url : `${filename}${search}`;
sampleContainerElem.appendChild(createElem('iframe', { src }));
sampleContainerElem.appendChild(createElem('iframe', { src, allowfullscreen: '' }));
sampleContainerElem.style.height = sources.length > 0 ? '600px' : '100%';
if (external) {
// For remote samples, get the source URL from the metadata.
Expand Down
2 changes: 1 addition & 1 deletion main.js.map

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions sample/alphaToCoverage/index.html

This file was deleted.

Loading

0 comments on commit 6acd373

Please sign in to comment.