Skip to content

Commit 7ce39a9

Browse files
committed
Update blur.ts
1 parent f5fe9e3 commit 7ce39a9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

manual/assets/js/src/demos/blur.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ window.addEventListener("load", () => void load().then((assets) => {
9191
// Post Processing
9292

9393
const mipmapBlurPass = new MipmapBlurPass({
94+
fullResolutionUpsampling: true,
9495
clampToBorder: false,
9596
radius: 1.0,
9697
levels: 1
@@ -103,7 +104,7 @@ window.addEventListener("load", () => void load().then((assets) => {
103104
});
104105

105106
gaussianBlurPass.enabled = false;
106-
const textureEffect = new TextureEffect({ texture: mipmapBlurPass.texture });
107+
const textureEffect = new TextureEffect({ texture: mipmapBlurPass.texture.value });
107108

108109
const outputPass = new EffectPass(
109110
textureEffect,
@@ -141,7 +142,9 @@ window.addEventListener("load", () => void load().then((assets) => {
141142

142143
mipmapBlurPass.enabled = (event.index === 0);
143144
gaussianBlurPass.enabled = (event.index === 1);
144-
textureEffect.texture = gaussianBlurPass.enabled ? gaussianBlurPass.texture : mipmapBlurPass.texture;
145+
textureEffect.texture = gaussianBlurPass.enabled ?
146+
gaussianBlurPass.texture.value :
147+
mipmapBlurPass.texture.value;
145148

146149
});
147150

@@ -158,11 +161,12 @@ window.addEventListener("load", () => void load().then((assets) => {
158161
const p0 = tab.pages[0];
159162
p0.addBinding(mipmapBlurPass, "radius", { min: 0, max: 1, step: 0.01 });
160163
p0.addBinding(mipmapBlurPass, "levels", { min: 1, max: 10, step: 1 });
164+
p0.addBinding(mipmapBlurPass, "fullResolutionUpsampling", { label: "fullResUpscale" });
161165

162166
const p1 = tab.pages[1];
167+
p1.addBinding(gaussianBlurPass.resolution, "scale", { label: "resolution", min: 0.5, max: 1, step: 0.05 });
163168
p1.addBinding(gaussianBlurPass.fullscreenMaterial, "kernelSize", { options: gaussKernels });
164169
p1.addBinding(gaussianBlurPass.fullscreenMaterial, "scale", { min: 0, max: 2, step: 0.01 });
165-
p1.addBinding(gaussianBlurPass.resolution, "scale", { label: "resolution", min: 0.5, max: 1, step: 0.05 });
166170
p1.addBinding(gaussianBlurPass, "iterations", { min: 1, max: 8, step: 1 });
167171

168172
// Resize Handler

0 commit comments

Comments
 (0)