-
setOpen(!open)}>
+
- {open
- ? sampleNames.map((slug) => {
- return (
-
onClickPageLink()}
- />
- );
- })
- : null}
+ {sampleNames.map((slug) => {
+ return (
+ onClickPageLink()}
+ />
+ );
+ })}
);
};
diff --git a/src/pages/MainLayout.module.css b/src/pages/MainLayout.module.css
index 81d5a652..ec8c4233 100644
--- a/src/pages/MainLayout.module.css
+++ b/src/pages/MainLayout.module.css
@@ -49,12 +49,9 @@
.panel .panelContents {
display: block;
transition: max-height 0s;
- overflow: none;
max-height: 100vh;
}
-
-
@media only screen and (max-width: 768px) {
/* More padding on mobile for easier touch screen use */
.exampleLink {
@@ -73,7 +70,6 @@
.panel .panelContents {
display: block;
transition: max-height 0.3s ease-out;
- overflow: none;
max-height: 0px;
}
diff --git a/src/pages/samples/[slug].tsx b/src/pages/samples/[slug].tsx
index 9bcba443..485ece14 100644
--- a/src/pages/samples/[slug].tsx
+++ b/src/pages/samples/[slug].tsx
@@ -13,7 +13,7 @@ type PageComponentType = {
[key: string]: React.ComponentType;
};
-const webGPUBasicsPages: PageComponentType = {
+const graphicsBasicsPages: PageComponentType = {
helloTriangle: dynamic(() => import('../../sample/helloTriangle/main')),
helloTriangleMSAA: dynamic(
() => import('../../sample/helloTriangleMSAA/main')
@@ -26,24 +26,24 @@ const webGPUBasicsPages: PageComponentType = {
cubemap: dynamic(() => import('../../sample/cubemap/main')),
};
-const featureDemoPages: PageComponentType = {
- cameras: dynamic(() => import('../../sample/cameras/main')),
+const webGPUFeaturesPages: PageComponentType = {
samplerParameters: dynamic(
() => import('../../sample/samplerParameters/main')
),
reversedZ: dynamic(() => import('../../sample/reversedZ/main')),
- normalMap: dynamic(() => import('../../sample/normalMap/main')),
renderBundles: dynamic(() => import('../../sample/renderBundles/main')),
- skinnedMesh: dynamic(() => import('../../sample/skinnedMesh/main')),
};
-const renderPassDemoPages: PageComponentType = {
+const graphicsDemoPages: PageComponentType = {
+ cameras: dynamic(() => import('../../sample/cameras/main')),
+ normalMap: dynamic(() => import('../../sample/normalMap/main')),
shadowMapping: dynamic(() => import('../../sample/shadowMapping/main')),
deferredRendering: dynamic(
() => import('../../sample/deferredRendering/main')
),
cornell: dynamic(() => import('../../sample/cornell/main')),
'A-buffer': dynamic(() => import('../../sample/a-buffer/main')),
+ skinnedMesh: dynamic(() => import('../../sample/skinnedMesh/main')),
};
const gpuComputeDemoPages: PageComponentType = {
@@ -68,9 +68,9 @@ const benchmarkPages: PageComponentType = {
};
const pages: PageComponentType = {
- ...webGPUBasicsPages,
- ...featureDemoPages,
- ...renderPassDemoPages,
+ ...graphicsBasicsPages,
+ ...webGPUFeaturesPages,
+ ...graphicsDemoPages,
...gpuComputeDemoPages,
...webPlatformPages,
...benchmarkPages,
@@ -94,10 +94,10 @@ const createPageCategory = (
};
export const pageCategories: PageCategory[] = [
- createPageCategory('WebGPU Basics', webGPUBasicsPages),
- createPageCategory('Feature Demos', featureDemoPages),
- createPageCategory('Render Pass Demos', renderPassDemoPages),
- createPageCategory('GPU Compute Demos', gpuComputeDemoPages),
+ createPageCategory('Basic Graphics', graphicsBasicsPages),
+ createPageCategory('WebGPU Features', webGPUFeaturesPages),
+ createPageCategory('Graphics Demos', graphicsDemoPages),
+ createPageCategory('Compute Demos', gpuComputeDemoPages),
createPageCategory('Web Platform Demos', webPlatformPages),
createPageCategory('Benchmarks', benchmarkPages),
];
From 95334d3cdd5a49a00bcf077de3a80e3dbb126dbd Mon Sep 17 00:00:00 2001
From: cmhhelgeson <62450112+cmhhelgeson@users.noreply.github.com>
Date: Wed, 28 Feb 2024 17:22:53 -0800
Subject: [PATCH 09/12] Moved stuffed around, added comments justifying each
category
---
src/pages/samples/[slug].tsx | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/src/pages/samples/[slug].tsx b/src/pages/samples/[slug].tsx
index 485ece14..3063513e 100644
--- a/src/pages/samples/[slug].tsx
+++ b/src/pages/samples/[slug].tsx
@@ -13,6 +13,7 @@ type PageComponentType = {
[key: string]: React.ComponentType;
};
+// Samples that implement basic rendering functionality using the WebGPU API.
const graphicsBasicsPages: PageComponentType = {
helloTriangle: dynamic(() => import('../../sample/helloTriangle/main')),
helloTriangleMSAA: dynamic(
@@ -26,6 +27,11 @@ const graphicsBasicsPages: PageComponentType = {
cubemap: dynamic(() => import('../../sample/cubemap/main')),
};
+// Samples that demonstrate functionality specific to WebGPU, or demonstrate the particularities
+// of how WebGPU implements a particular feature within its api. For instance, while many of the
+// sampler parameters in the 'samplerParameters' sample have direct analogues in other graphics api,
+// the primary purpose of 'sampleParameters' is to demonstrate their specific nomenclature and
+// functionality within the context of the WebGPU API.
const webGPUFeaturesPages: PageComponentType = {
samplerParameters: dynamic(
() => import('../../sample/samplerParameters/main')
@@ -34,6 +40,9 @@ const webGPUFeaturesPages: PageComponentType = {
renderBundles: dynamic(() => import('../../sample/renderBundles/main')),
};
+// A selection of samples demonstrating various graphics techniques, utilizing various features
+// of the WebGPU API, and often executing render and compute pipelines in tandem to achieve their
+// visual results.
const graphicsDemoPages: PageComponentType = {
cameras: dynamic(() => import('../../sample/cameras/main')),
normalMap: dynamic(() => import('../../sample/normalMap/main')),
@@ -41,19 +50,27 @@ const graphicsDemoPages: PageComponentType = {
deferredRendering: dynamic(
() => import('../../sample/deferredRendering/main')
),
+ particles: dynamic(() => import('../../sample/particles/main')),
+ imageBlur: dynamic(() => import('../../sample/imageBlur/main')),
cornell: dynamic(() => import('../../sample/cornell/main')),
'A-buffer': dynamic(() => import('../../sample/a-buffer/main')),
skinnedMesh: dynamic(() => import('../../sample/skinnedMesh/main')),
};
+// Samples that demonstrate the gpgpu functionality of WebGPU. These samples generally
+// provide a two-dimensional visual representation of the result of a compute operation.
+// Accordingly, the rendering functionality of these samples exists primarily to demonstrate
+// the results of these operations. As a general rule of thumb, if the visual output of the
+// sample could just as easily be displayed using the canvas's 2D rendering context, then it
+// belongs within this category.
const gpuComputeDemoPages: PageComponentType = {
- imageBlur: dynamic(() => import('../../sample/imageBlur/main')),
computeBoids: dynamic(() => import('../../sample/computeBoids/main')),
- particles: dynamic(() => import('../../sample/particles/main')),
gameOfLife: dynamic(() => import('../../sample/gameOfLife/main')),
bitonicSort: dynamic(() => import('../../sample/bitonicSort/main')),
};
+// Samples that demonstrate how to integrate WebGPU and/or WebGPU render operations with other
+// functionalities provided by the web platform.
const webPlatformPages: PageComponentType = {
resizeCanvas: dynamic(() => import('../../sample/resizeCanvas/main')),
videoUploading: dynamic(() => import('../../sample/videoUploading/main')),
@@ -63,6 +80,7 @@ const webPlatformPages: PageComponentType = {
worker: dynamic(() => import('../../sample/worker/main')),
};
+// Samples whose primary purpose is to benchmark WebGPU performance.
const benchmarkPages: PageComponentType = {
animometer: dynamic(() => import('../../sample/animometer/main')),
};
@@ -96,8 +114,8 @@ const createPageCategory = (
export const pageCategories: PageCategory[] = [
createPageCategory('Basic Graphics', graphicsBasicsPages),
createPageCategory('WebGPU Features', webGPUFeaturesPages),
- createPageCategory('Graphics Demos', graphicsDemoPages),
- createPageCategory('Compute Demos', gpuComputeDemoPages),
+ createPageCategory('GPGPU Demos', gpuComputeDemoPages),
+ createPageCategory('Graphics Techniques', graphicsDemoPages),
createPageCategory('Web Platform Demos', webPlatformPages),
createPageCategory('Benchmarks', benchmarkPages),
];
From f05a846bf6c34e41b9a3babd1e2b82480f83b6e0 Mon Sep 17 00:00:00 2001
From: cmhhelgeson <62450112+cmhhelgeson@users.noreply.github.com>
Date: Wed, 28 Feb 2024 17:23:44 -0800
Subject: [PATCH 10/12] Capitalize GPGPU
---
src/pages/samples/[slug].tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pages/samples/[slug].tsx b/src/pages/samples/[slug].tsx
index 3063513e..c536a051 100644
--- a/src/pages/samples/[slug].tsx
+++ b/src/pages/samples/[slug].tsx
@@ -57,11 +57,11 @@ const graphicsDemoPages: PageComponentType = {
skinnedMesh: dynamic(() => import('../../sample/skinnedMesh/main')),
};
-// Samples that demonstrate the gpgpu functionality of WebGPU. These samples generally
+// Samples that demonstrate the GPGPU functionality of WebGPU. These samples generally
// provide a two-dimensional visual representation of the result of a compute operation.
// Accordingly, the rendering functionality of these samples exists primarily to demonstrate
// the results of these operations. As a general rule of thumb, if the visual output of the
-// sample could just as easily be displayed using the canvas's 2D rendering context, then it
+// sample could just as easily be generated using the canvas's 2D rendering context, then it
// belongs within this category.
const gpuComputeDemoPages: PageComponentType = {
computeBoids: dynamic(() => import('../../sample/computeBoids/main')),
From 40ee507708af00366196f0c333ccca2ab7d521cf Mon Sep 17 00:00:00 2001
From: cmhhelgeson <62450112+cmhhelgeson@users.noreply.github.com>
Date: Wed, 28 Feb 2024 17:37:08 -0800
Subject: [PATCH 11/12] Added more specific comments to gpgpu section
---
src/pages/samples/[slug].tsx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/pages/samples/[slug].tsx b/src/pages/samples/[slug].tsx
index c536a051..b7f6504a 100644
--- a/src/pages/samples/[slug].tsx
+++ b/src/pages/samples/[slug].tsx
@@ -58,11 +58,13 @@ const graphicsDemoPages: PageComponentType = {
};
// Samples that demonstrate the GPGPU functionality of WebGPU. These samples generally
-// provide a two-dimensional visual representation of the result of a compute operation.
-// Accordingly, the rendering functionality of these samples exists primarily to demonstrate
-// the results of these operations. As a general rule of thumb, if the visual output of the
-// sample could just as easily be generated using the canvas's 2D rendering context, then it
-// belongs within this category.
+// provide a visual representation of the result of a compute operation. Accordingly, the rendering
+// functionality of these samples exists soley to demonstrate the results of these operations.
+// As a general rule of thumb, samples within this category should be of two types:
+// 1. Visualizations of compute operations where the rendering is or could just as effectively be
+// implemented within canvas2D with minimal changes to the code.
+// 2. Visualizations of compute features that are endemic to the domain of machine learning or A.I
+// such as 'f16', convolution, backpropogation, etc.
const gpuComputeDemoPages: PageComponentType = {
computeBoids: dynamic(() => import('../../sample/computeBoids/main')),
gameOfLife: dynamic(() => import('../../sample/gameOfLife/main')),
From 14c55f87b0695088713a83633944f7c2562941a5 Mon Sep 17 00:00:00 2001
From: cmhhelgeson <62450112+cmhhelgeson@users.noreply.github.com>
Date: Thu, 29 Feb 2024 12:26:22 -0800
Subject: [PATCH 12/12] Cambios pequenos
---
src/components/SampleCategory.module.css | 15 ---------------
src/pages/MainLayout.module.css | 4 ----
src/pages/samples/[slug].tsx | 16 ++++++----------
3 files changed, 6 insertions(+), 29 deletions(-)
diff --git a/src/components/SampleCategory.module.css b/src/components/SampleCategory.module.css
index 3dd5d7f8..abc8e616 100644
--- a/src/components/SampleCategory.module.css
+++ b/src/components/SampleCategory.module.css
@@ -1,22 +1,7 @@
-@keyframes openTriangle {
- from { transform: rotate(0deg); }
- to { transform: rotate(180deg); }
-}
-
-@keyframes closeTriangle {
- from { transform: rotate(180deg); }
- to { transform: rotate(0deg); }
-}
-
.sampleCategory {
display: flex;
}
-.dropdown {
- margin-left: 8px;
- margin-top: 7px;
- margin-bottom: 5px;
-}
li.selected a {
color: #ff0000;
diff --git a/src/pages/MainLayout.module.css b/src/pages/MainLayout.module.css
index ec8c4233..f91ac2a9 100644
--- a/src/pages/MainLayout.module.css
+++ b/src/pages/MainLayout.module.css
@@ -32,10 +32,6 @@
padding: 0.3em 0;
}
-.exampleList li.selected a {
- color: #ff0000;
-}
-
.expand {
display: none;
float: right;
diff --git a/src/pages/samples/[slug].tsx b/src/pages/samples/[slug].tsx
index b7f6504a..9ccaeff8 100644
--- a/src/pages/samples/[slug].tsx
+++ b/src/pages/samples/[slug].tsx
@@ -42,7 +42,7 @@ const webGPUFeaturesPages: PageComponentType = {
// A selection of samples demonstrating various graphics techniques, utilizing various features
// of the WebGPU API, and often executing render and compute pipelines in tandem to achieve their
-// visual results.
+// visual results. The techniques demonstrated may even be independent of WebGPU (e.g. 'cameras')
const graphicsDemoPages: PageComponentType = {
cameras: dynamic(() => import('../../sample/cameras/main')),
normalMap: dynamic(() => import('../../sample/normalMap/main')),
@@ -57,14 +57,10 @@ const graphicsDemoPages: PageComponentType = {
skinnedMesh: dynamic(() => import('../../sample/skinnedMesh/main')),
};
-// Samples that demonstrate the GPGPU functionality of WebGPU. These samples generally
-// provide a visual representation of the result of a compute operation. Accordingly, the rendering
-// functionality of these samples exists soley to demonstrate the results of these operations.
-// As a general rule of thumb, samples within this category should be of two types:
-// 1. Visualizations of compute operations where the rendering is or could just as effectively be
-// implemented within canvas2D with minimal changes to the code.
-// 2. Visualizations of compute features that are endemic to the domain of machine learning or A.I
-// such as 'f16', convolution, backpropogation, etc.
+// Samples that demonstrate the GPGPU functionality of WebGPU. These samples generally provide some
+// user-facing representation (e.g. image, text, or audio) of the result of compute operations.
+// Any rendering code is primarily for visualization, not key to the unique part of the sample;
+// rendering could also be done using canvas2D without detracting from the sample's usefulness.
const gpuComputeDemoPages: PageComponentType = {
computeBoids: dynamic(() => import('../../sample/computeBoids/main')),
gameOfLife: dynamic(() => import('../../sample/gameOfLife/main')),
@@ -118,7 +114,7 @@ export const pageCategories: PageCategory[] = [
createPageCategory('WebGPU Features', webGPUFeaturesPages),
createPageCategory('GPGPU Demos', gpuComputeDemoPages),
createPageCategory('Graphics Techniques', graphicsDemoPages),
- createPageCategory('Web Platform Demos', webPlatformPages),
+ createPageCategory('Web Platform Integration', webPlatformPages),
createPageCategory('Benchmarks', benchmarkPages),
];