We will be out of office from December 23th to January 7th. During this time we'll check the forums less often, we'll be back at full throttle soon. Take care, Merry Christmas!
29-03-2019, 01:38 PM (This post was last modified: 31-03-2019, 09:23 AM by mimarilker.)
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!
01-04-2019, 07:15 AM (This post was last modified: 01-04-2019, 07:16 AM by josemendez.)
(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.
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.
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.
10-04-2019, 12:47 PM (This post was last modified: 10-04-2019, 12:49 PM by josemendez.)
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.
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 available
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?
16-04-2019, 12:52 PM (This post was last modified: 16-04-2019, 01:00 PM by mimarilker.)
(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
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];
//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];
//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.
(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];
//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!