paleRider Posted August 9, 2017 Share Posted August 9, 2017 Hi everybody. In order to give a realistic look to a shower/rain using particles I'd like to know if is possible to add motion blur to them. May be it can be done by means of the customEffect parameter of ParticleSystem constructor, but I don´t know if this assumption is correct. Best regards. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 9, 2017 Share Posted August 9, 2017 Hey this is an option but you can also turn on the standard rendering pipeline and enable motion blur: http://doc.babylonjs.com/tutorials/using_standard_rendering_pipeline Quote Link to comment Share on other sites More sharing options...
paleRider Posted August 10, 2017 Author Share Posted August 10, 2017 Thank you for your time and immediate response. Only to be clear about your explanation, using the pipeline the "motion blur" is applied to all the (visible) entities in the scene, isn´t it? Assuming a "yes", I need to take the "customEffect way" in order to apply that post effect to particles (rain/shower) only. Am I right? Best regards. Quote Link to comment Share on other sites More sharing options...
jerome Posted August 10, 2017 Share Posted August 10, 2017 Why not simply blurring the image used for the particle texture ? Maybe you could also implement some kind of particle trailing behavior and play with some decreasing alpha ... example of trailing particle principle (with a SPS here, but it's the same with the standard particle system) : http://jerome.bousquie.fr/BJS/demos/trailingParticles.html paleRider 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 10, 2017 Share Posted August 10, 2017 You are right Quote Link to comment Share on other sites More sharing options...
paleRider Posted August 14, 2017 Author Share Posted August 14, 2017 Thanks for your time and opinion, jerome: Certainly, to implement trailing particles the way you show could be a good focus, but I'm very concerned about the performance penalty of using even more particles (the ones at the trail) that I'm already using (in order to have a realistic shower-like "water falling"). That's the reason because I'm personally inclined towards a motion-blur solution. This way I see I have two motion-blur options: camera-scene based via standard-rendering-pipeline, as documented at https://doc.babylonjs.com/tutorials/using_standard_rendering_pipeline (by the way in the Tutorials doc there is a typo, as pipeline.MotionBlurEnabled can be read instead of pipeline.motionBlurEnabled); only-particles via customEffect (4th parameter of ParticleSystem constructor), that I presume can be done following the Deltakosh PG: http://www.babylonjs-playground.com/#1TO2YJ#3 I'm going to investigate a bit about it. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
paleRider Posted October 18, 2017 Author Share Posted October 18, 2017 Dear Deltakosh: I'm now finally with the tests on the motion-blur (amazing world). My roadmap is to taste the different flavors BJS provides (please let me know if I've left any out): pipeline based motion-blur; post-process effect motion-blur; particle effect motion-blur. I'm assuming the first two option are "per-scene" and only the third can achieve the effect in a, let's call it, "per-item" approach. The case is that at the very first intent (a super basic pipeline motion-blur) I get "strange" results: http://www.babylonjs-playground.com/#49XARW The glow is there even harder with the addition of the expected "pipeline.MotionBlurEnabled=true;" line: http://www.babylonjs-playground.com/#49XARW#1 Any idea about what is happening here? Thanks for your time. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 18, 2017 Share Posted October 18, 2017 let me ping the mastermind behind the stdPipeline: @Luaacro Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 18, 2017 Share Posted October 18, 2017 You are right!!! The glow effect must not be harder when activating only the motion Blur, I have to fix it for the particle effect I’m not sure to provide a solution ASAP because I haven’t the base yet which is the « per-object motion Blur » Anyway, I add it to my todo list! Thanks for these feedbacks and don’t hesitate if you find another issue paleRider 1 Quote Link to comment Share on other sites More sharing options...
paleRider Posted October 19, 2017 Author Share Posted October 19, 2017 Hi Luaccro and Deltakosh: I understand we must have not glow at all, of course when we are only activating the pipeline, but also when adding exclusively the motion blur effect. Isn't it? About the subject of particles with motion blur (that is my real goal in this as particles usually are small and fast and so blur bound) my concern is: is it worthy to investigate the "customEffect" parameter (4th) of ParticleSystem constructor? I'm asking this because now I have doubts about if them are passing for different stages of the pipeline and so they are not able to being motion-blurred? Thanks for your time. Best regards. Quote Link to comment Share on other sites More sharing options...
paleRider Posted October 20, 2017 Author Share Posted October 20, 2017 Hi again. Any news about my last comments? I really need to have my particles with a motion blur in order to achieve a realistic look. So here come again: is it possible to have motion blur on particles with the current version (3.0) of BJS? I mean using "per object postpro effect" (not the whole scene pipeline) or, even better, using "ParticleSystem customEffect". As said the last posts has brought me some doubts. If the answer is "not", I'll try the Jerome solution (mentioned before in this same thread) of using "trailing particles with some decreasing alpha" even I think it could have a performance hit over the "effect" solution. Thanks for your time. Best regards. Quote Link to comment Share on other sites More sharing options...
jerome Posted October 20, 2017 Share Posted October 20, 2017 Note you can also animate particles (like sprites from a texture atlas) so you could play either with alpha and different version of the same image slightly blurred paleRider 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 20, 2017 Share Posted October 20, 2017 I plan to add support for trails for particles soon https://github.com/BabylonJS/Babylon.js/issues/2971 paleRider 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 20, 2017 Share Posted October 20, 2017 @paleRider not now, the motion blur is a classic post-process right now and does not allow per-object motion blur This is in my todo list, contributions are open if you have some ideas on how to implement it paleRider 1 Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted October 22, 2017 Share Posted October 22, 2017 @Luaacro I have seen some animation about speed buffer based motion blur:https://otakhi.tumblr.com/post/166606704295/per-pixel-and-velocity-buffer-based-motion-blur (This extremly unusable oTakhi page with very valuable videos and techniques... Lot to learn from) Quote Link to comment Share on other sites More sharing options...
paleRider Posted October 23, 2017 Author Share Posted October 23, 2017 Hi everybody,... and thank you for all your comments. As I need my particles blurred right now, for a project I must end ASAP, I'm going to try "the sprite way" as has been recommended by Jerome. I think that, after all, doing this the old-way (or the 2D-way) is going to be less processor exhausting and more easy to tweak in order to get the right aesthetics. I'll keep you up-to-date. Best regards. GameMonetize and julien-moreau 2 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 28, 2017 Share Posted October 28, 2017 Thanks @paleRider! I'll also let you know when the motion blur will be "per-object" as well paleRider 1 Quote Link to comment Share on other sites More sharing options...
paleRider Posted November 2, 2017 Author Share Posted November 2, 2017 Hi everybody: I'm here again with this subject of simulating shower water strikes, by means of particles. Ok. After searching here and there we found an impressive graphic repository provided by the always good people of Columbia University (Photorealistic Rendering of Rain Streaks) With these impressive assets, and in order to have a performance efficient code, we'd like to use a "sprite-atlas" or "texture-sheet" (as you prefer) with ten "water strikes" side-by-side, this way: I know that "Starting from Babylon.js v3.1 particle system will allow particle animation using animation sheet.", but (again) we're in a production development, and so we must use a stable version of BJS, that is v3.0. Having said this, my question is: is there any way to use "sprite-atlas"/"texture-sheet" with BJS v3.0 particles or, by contrast, we need to split it in individual textures and use them that way? Thanks for your time... and best regards. P.D. Please, make BJS v3.1 stable production as soon as possible. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 2, 2017 Share Posted November 2, 2017 I am not sure if you are marking this solved or not, but think a suggestion could be being thrown away out of hand. That is drawing streak(s) on the texture. You might also draw a small handful to compensate for the number of drops, like in the image you just posted, power of 2 of course, and with alpha. I got this from a previous thread, but smoke from this scene works great using this. (Hit play and the camera will move closer to the smoke.) paleRider 1 Quote Link to comment Share on other sites More sharing options...
paleRider Posted November 2, 2017 Author Share Posted November 2, 2017 Hi JCPalmer: First of all, this question is still not solved (I try to follow this forum good practice of adding a "red solved mark"). About my question, the referred water strike images work like a charm. They look perfectly realistic. That is not my point here. My doubt is about optimize resources using a "texture sheet" (aka "sprite atlas"). This way, I'd like to know if: is possible to have a single emitter with different textures (sprites) being emitted? is possible to have a single emitter with different textures from the same "texture sheet" being emitted? I think it is only possible with BJS v3.1, using its brand new particle animation functionality (the following is an excerpt from docs): var particleSystem = new BABYLON.ParticleSystem("particles", 2000, scene, null, true); particleSystem.particleTexture = new BABYLON.Texture("textures/player.png", scene, true, false, BABYLON.Texture.TRILINEAR_SAMPLINGMODE); particleSystem.startSpriteCellID = 0; particleSystem.endSpriteCellID = 44; particleSystem.spriteCellHeight = 64; particleSystem.spriteCellWidth = 64; particleSystem.spriteCellLoop = true; particleSystem.spriteCellChangeSpeed = 4; // default is zero Sadly, this is a production development and we need the stable version (v3.0) of the engine, and so, If I'm right with my assumptions, we have to do it using an emitter for each different sprite and, of course, not "texture sheet" at all. Thanks for your time. Best regards. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 2, 2017 Share Posted November 2, 2017 Bjs 3.1 will be released by end of november https://github.com/BabylonJS/Babylon.js/milestone/6 paleRider 1 Quote Link to comment Share on other sites More sharing options...
paleRider Posted November 2, 2017 Author Share Posted November 2, 2017 Thanks for the info Deltakosh: We'll have it in mind for the v2.0 of this development. 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.