Search the Community
Showing results for tags 'blurpostprocess'.
-
Hiya all. Just joined up here- seems like a fantastic community, great stuff. Learning a lot from you guys. In this previous Q&A (thanks guys) there was a discussion about adjusting a "fade" post process after its creation, via scene.registerBeforeRender(function(){}); Here's the afore mentioned code snippet for where the post process gets created. var fadeLevel = 1; var postProcess_fade = new BABYLON.PostProcess("Fade", "fade", ["fadeLevel"], null, 1.0, camera); postProcess_fade.onApply = (effect) => { effect.setFloat("fadeLevel", fadeLevel); }; Lets say I wanted to do the same on other post processes such as a horizontal Blur (increasing blur on a certain event for example). I sorta tried doing a similar thing.... var kernel=50; var postProcess_Blur = new BABYLON.BlurPostProcess("Horizontal blur",new BABYLON.Vector2(1.0,0.0), ["kernel"], 1, camera); postProcess_Blur.onApply = (effect) => { effect.setFloat("kernel", kernel); }; ...the scene / canvas all initialises ok, but it's drawing a black frame. Not sure if its because of some difference with the blur post process in particular? https://doc.babylonjs.com/classes/3.0/blurpostprocess says the parameter name is "kernel". Thanks v much for any insights or assistance. *edit: link to playground https://www.babylonjs-playground.com/#K9NTY4#6 *edit: solved https://www.babylonjs-playground.com/#K9NTY4#7