jools_n_jops Posted September 9, 2017 Share Posted September 9, 2017 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 Quote Link to comment Share on other sites More sharing options...
jools_n_jops Posted September 10, 2017 Author Share Posted September 10, 2017 Ah got it.. just need to edit the postProcess object .kernel on the event.. postProcess_Blur.kernel=1; Sometimes when you ask a question your brain answers it for you Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 10, 2017 Share Posted September 10, 2017 hah. Glad you found your solve. Welcome to the forum, good to have you with us. Thanks for teaching us these discoveries... well done. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.