From 4cd022cc040fcb0efced49702167455d16662e30 Mon Sep 17 00:00:00 2001 From: Kevin Brown <10319625+AmoebaChant@users.noreply.github.com> Date: Fri, 21 Aug 2026 15:30:55 -0700 Subject: [PATCH] Document AutoSample UV limitation Refs https://github.com/AmoebaChant/pan-work/issues/95 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../features/featuresDeepDive/smartFilters/creatingNewBlocks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/features/featuresDeepDive/smartFilters/creatingNewBlocks.md b/content/features/featuresDeepDive/smartFilters/creatingNewBlocks.md index a233cb1a7..6c128f113 100644 --- a/content/features/featuresDeepDive/smartFilters/creatingNewBlocks.md +++ b/content/features/featuresDeepDive/smartFilters/creatingNewBlocks.md @@ -240,6 +240,7 @@ import { uniforms, shaderProgram } from "./compositionBlock.fragment.js"; - Disableable means that it will have a disabled input connection point, and will automatically pass the main input texture through to the output if the block is disabled - This is helpful in applications that may allow the user to turn many effects on and off, since this allows effects to be disabled instantly without the need to build a new Smart Filter runtime - There are different disable strategies you can choose to get the best shader performance, based on the details of your block (see `BlockDisableStrategy` in [disableableShaderBlock.ts](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/smartFilters/src/blockFoundation/disableableShaderBlock.ts)) + - Do not use the `AutoSample` strategy if your shader modifies `vUV` before sampling the main input texture. `AutoSample` samples the texture with the original `vUV`; use the `Manual` strategy instead - You must specify a main input when creating a disableable shader block - In your fragment shader, you must put `// main` on the line that declares the uniform to be treated as the main input texture - If you choose the manual strategy, your fragment shader must check a uniform named `disabled`, which the system will add for you, and if it is true, return texture2D(your_main_input_texture, vUV)