Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ObiParticleRenderer
#1
Hi,

Is it possible to duplicate particles in visual without increasing the actual numbers of particles? Then I can use ObiParticleRenderer instead of Unity Native Particle System which cannot visualize viscosity, vorticity, pressure etc.

If this is not possible is there a way to utilize Unity Native Particle System to render not speed only but also the other parameters as I mentioned (viscosity, density, vorticity etc.).

Last, your support and the asset are amazing and you the people reading this post, don't think even for one second before buying this excellent asset!
Reply
#2
(29-03-2019, 01:38 PM)mimarilker Wrote: Hi,

Is it possible to duplicate particles in visual without increasing the actual numbers of particles? Then I can use ObiParticleRenderer instead of Unity Native Particle System which cannot visualize viscosity, vorticity, pressure etc.

If this is not possible is there a way to utilize Unity Native Particle System to render not speed only but also the other parameters as I mentioned (viscosity, density, vorticity etc.).

Last, your support and the asset are amazing and you the people reading this post, don't think even for one second before buying this excellent asset!

Hi there!

Not currently possible. The renderer gets all particle data directly from the actor it is rendering. You would have to heavily modify its code to allow for extra custom particles to be rendered, which is possible but a lot of work.

The alternative of using Unity particles to render fluid properties is pretty expensive. Currently only velocities are interpolated from the surrounding fluid particles, the ability of rendering any other property would require interpolating them too. I will look into the best way to achieve this without sacrificing performance, but currently I'd say it cannot be done.

Note that ObiParticleRenderer does not render "real" spheres, it renders each particle as a quad with a special shader that makes it look like an actual sphere (technique known as ellipsoid splatting). This is quite cheap and comparable to rendering regular particles. The cost of fluid particles mainly comes from simulation, which is why using diffuse particle advection is interesting as advecting particles does not involve any particle-particle interaction and can very efficiently be done in parallel.
Reply
#3
(01-04-2019, 07:15 AM)josemendez Wrote: Hi there!

Not currently possible. The renderer gets all particle data directly from the actor it is rendering. You would have to heavily modify its code to allow for extra custom particles to be rendered, which is possible but a lot of work.

The alternative of using Unity particles to render fluid properties is pretty expensive. Currently only velocities are interpolated from the surrounding fluid particles, the ability of rendering any other property would require interpolating them too. I will look into the best way to achieve this without sacrificing performance, but currently I'd say it cannot be done.

Note that ObiParticleRenderer does not render "real" spheres, it renders each particle as a quad with a special shader that makes it look like an actual sphere (technique known as ellipsoid splatting). This is quite cheap and comparable to rendering regular particles. The cost of fluid particles mainly comes from simulation, which is why using diffuse particle advection is interesting as advecting particles does not involve any particle-particle interaction and can very efficiently be done in parallel.

Hi,

I think you mean using Unity particles, the other properties like pressure, viscosity can be interpolated like velocity, but it will badly effect performance. Actually, the performance issue is ok for me. Please just show me how to interpolate them with the Unity Particle system. Thanks for your support.
Reply
#4
(09-04-2019, 09:55 AM)mimarilker Wrote: Hi,

I think you mean using Unity particles, the other properties like pressure, viscosity can be interpolated like velocity, but it will badly effect performance. Actually, the performance issue is ok for me. Please just show me how to interpolate them with the Unity Particle system. Thanks for your support.

Hi there,

Not currently possible with the existing API, we're extending it to allow interpolation of arbitrary properties. Please bear with us while we implement this.

kind regards,
Reply
#5
Hi,

Chiming in to say that this feature has been implemented and will be available in the next update. It will be possible to interpolate any fluid particle property, not just velocities. Only the required properties will be interpolated, so you can just interpolate velocities and densities, for instance. This reduces the performance hit compared to interpolating all at once.

kind regards,
Reply
#6
(10-04-2019, 12:47 PM)josemendez Wrote: Hi,

Chiming in to say that this feature has been implemented and will be available in the next update. It will be possible to interpolate any fluid particle property, not just velocities. Only the required properties will be interpolated, so you can just interpolate velocities and densities, for instance. This reduces the performance hit compared to interpolating all at once.

kind regards,

Wow, it’s amazing! So, the question is when the next update will be availableSonrisa
Reply
#7
(10-04-2019, 02:15 PM)mimarilker Wrote: Wow, it’s amazing! So, the question is when the next update will be availableSonrisa

We're aiming to upload to the store next monday, so if everything goes well by the end of next week. Sonrisa

Lots of goodies if you're using granulars, too: rolling contacts w/rolling friction, improved friction model, particle-particle collision callbacks..
Reply
#8
(10-04-2019, 04:24 PM)josemendez Wrote: We're aiming to upload to the store next monday, so if everything goes well by the end of next week. Sonrisa

Lots of goodies if you're using granulars, too: rolling contacts w/rolling friction, improved friction model, particle-particle collision callbacks..

Hi,

Thanks for the update! I have imported Obi to a new project and tried to run KarmanVortex scene. However, I got an error with ParticleAdvector.cs Triste

ArgumentNullException: Value cannot be null.
Parameter name: particles
UnityEngine.ParticleSystem.GetParticles (UnityEngine.ParticleSystem+Particle[] particles, System.Int32 size) (at C:/buildslave/unity/build/Runtime/ParticleSystem/ScriptBindings/ParticleSystem.bindings.cs:243)
UnityEngine.ParticleSystem.GetParticles (UnityEngine.ParticleSystem+Particle[] particles) (at C:/buildslave/unity/build/Runtime/ParticleSystem/ScriptBindings/ParticleSystem.bindings.cs:244)
Obi.ParticleAdvector.ReallocateParticles () (at Assets/Obi/Scripts/Emitter/ParticleAdvector.cs:49)

(16-04-2019, 09:42 AM)mimarilker Wrote: Hi,

Thanks for the update! I have imported Obi to a new project and tried to run KarmanVortex scene. However, I got an error with ParticleAdvector.cs Triste

ArgumentNullException: Value cannot be null.
Parameter name: particles
UnityEngine.ParticleSystem.GetParticles (UnityEngine.ParticleSystem+Particle[] particles, System.Int32 size) (at C:/buildslave/unity/build/Runtime/ParticleSystem/ScriptBindings/ParticleSystem.bindings.cs:243)
UnityEngine.ParticleSystem.GetParticles (UnityEngine.ParticleSystem+Particle[] particles) (at C:/buildslave/unity/build/Runtime/ParticleSystem/ScriptBindings/ParticleSystem.bindings.cs:244)
Obi.ParticleAdvector.ReallocateParticles () (at Assets/Obi/Scripts/Emitter/ParticleAdvector.cs:49)

I have compared the older ParticleAdvector.cs with the new one. It seems that Solver_OnStepBegin is not included anymore, ad the line causing the error "alive = ps.GetParticles(particles);" is in the ReallocateParticles() which was in Solver_OnStepBegin, before. Could you please check it out?
Reply
#9
(16-04-2019, 09:42 AM)mimarilker Wrote: Hi,

Thanks for the update! I have imported Obi to a new project and tried to run KarmanVortex scene. However, I got an error with ParticleAdvector.cs Triste

ArgumentNullException: Value cannot be null.
Parameter name: particles
UnityEngine.ParticleSystem.GetParticles (UnityEngine.ParticleSystem+Particle[] particles, System.Int32 size) (at C:/buildslave/unity/build/Runtime/ParticleSystem/ScriptBindings/ParticleSystem.bindings.cs:243)
UnityEngine.ParticleSystem.GetParticles (UnityEngine.ParticleSystem+Particle[] particles) (at C:/buildslave/unity/build/Runtime/ParticleSystem/ScriptBindings/ParticleSystem.bindings.cs:244)
Obi.ParticleAdvector.ReallocateParticles () (at Assets/Obi/Scripts/Emitter/ParticleAdvector.cs:49)


I have compared the older ParticleAdvector.cs with the new one. It seems that Solver_OnStepBegin is not included anymore, ad the line causing the error "alive = ps.GetParticles(particles);" is in the ReallocateParticles() which was in Solver_OnStepBegin, before. Could you please check it out?

I have resolved the problem by calling "alive = ps.GetParticles(particles);" in the "Solver_OnStepEnd" (see the attachment). However, I couldn't colourize unity native particles according to the other parameters like viscosity and vorticity. I am trying to colourize particles according to pressure. I thought that in this version it is possible. Btw, I can do colourize Obi particles according to pressure with ObiParticleRenderer like that;

void E_Solver_OnFrameEnd (object sender, EventArgs e)
{
if (!isActiveAndEnabled)
return;

for (int i = 0; i < emitter.particleIndices.Length; ++i)
{
int k = emitter.particleIndices[i];
float density = emitter.Solver.fluidData[k][0];
float restDensity = emitter.Solver.restDensities[k];

//calculate pressure
float Pressure = (density - restDensity) ;

//colorize Obi Particles according to pressure with considering user defined min and max values.
emitter.colors[i] = grad.Evaluate((Pressure - min) / (max - min));


}
}

(16-04-2019, 12:52 PM)mimarilker Wrote: I have resolved the problem by calling "alive = ps.GetParticles(particles);" in the "Solver_OnStepEnd" (see the attachment). However, I couldn't colourize unity native particles according to the other parameters like viscosity and vorticity. I am trying to colourize particles according to pressure. I thought that in this version it is possible. Btw, I can do colourize Obi particles according to pressure with ObiParticleRenderer like that;

void E_Solver_OnFrameEnd (object sender, EventArgs e)
{
   if (!isActiveAndEnabled)
return;

           for (int i = 0; i < emitter.particleIndices.Length; ++i)
       {
               int k = emitter.particleIndices[i];
               float density = emitter.Solver.fluidData[k][0];
               float restDensity = emitter.Solver.restDensities[k];
               
               //calculate pressure
               float Pressure = (density - restDensity) ;

               //colorize Obi Particles according to pressure with considering user defined min and max values.
               emitter.colors[i] = grad.Evaluate((Pressure - min) / (max - min));
             

           }
   }

Sorry for posting too much, but the script that I attached seemed to work to me, however, I have noticed that it's very problematic with respect to performance. So please don't consider it as a solution.


Attached Files
.cs   ParticleAdvector.cs (Size: 2.65 KB / Downloads: 1)
Reply
#10
(16-04-2019, 12:52 PM)mimarilker Wrote: I have resolved the problem by calling "alive = ps.GetParticles(particles);" in the "Solver_OnStepEnd" (see the attachment). However, I couldn't colourize unity native particles according to the other parameters like viscosity and vorticity. I am trying to colourize particles according to pressure. I thought that in this version it is possible. Btw, I can do colourize Obi particles according to pressure with ObiParticleRenderer like that;

void E_Solver_OnFrameEnd (object sender, EventArgs e)
{
   if (!isActiveAndEnabled)
return;

           for (int i = 0; i < emitter.particleIndices.Length; ++i)
       {
               int k = emitter.particleIndices[i];
               float density = emitter.Solver.fluidData[k][0];
               float restDensity = emitter.Solver.restDensities[k];
               
               //calculate pressure
               float Pressure = (density - restDensity) ;

               //colorize Obi Particles according to pressure with considering user defined min and max values.
               emitter.colors[i] = grad.Evaluate((Pressure - min) / (max - min));
             

           }
   }


Sorry for posting too much, but the script that I attached seemed to work to me, however, I have noticed that it's very problematic with respect to performance. So please don't consider it as a solution.

Hi,

I believe we answered all your questions via email. Please check it out! Sonrisa
Reply