Jump to content

Motion Blur available on Particles?


paleRider
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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:

  1. 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);
  2. 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.

Link to comment
Share on other sites

  • 2 months later...

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

point-light_size16_cv0_v10_h10_Gd.png.d8f1d4c78691fa636b1af2fbdddd1639.png

 

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. ;)

Link to comment
Share on other sites

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.)

smoke.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...