Rain with NxOgre

rromulo

23-07-2011 10:57:17

Hi,

I would love to do rain with nxogre but I really don't know what to put exactly in each property once I don't have a parameter.
Its this format right now:

NxOgre::FluidDescription desc;
desc.mMaxParticles = 60000;
desc.mKernelRadiusMultiplier = 1.0f;
desc.mRestParticlesPerMetre = 0.2;
desc.mMotionLimitMultiplier = 1.0f;
desc.mPacketSizeMultiplier = 8;
desc.mCollisionDistanceMultiplier = 0.1f;
desc.mStiffness = 1;
desc.mViscosity = 6;
desc.mRestDensity = 0.01f;
desc.mDamping = 0.0f;
desc.mFadeInTime = 0.0f;
desc.mRestitutionForStaticShapes = 0.0f;
desc.mRestitutionForDynamicShapes = 0.0f;
desc.mDynamicFrictionForStaticShapes = 0.9f;
desc.mDynamicFrictionForDynamicShapes = 0.9f;
desc.mCollisionResponseCoefficient = 3.0f;
desc.mStaticFrictionForDynamicShapes = 0.9f;
desc.mStaticFrictionForStaticShapes = 0.9f;
desc.mSurfaceTension = 0.3f;
desc.mSimulationMethod = NxOgre::Enums::FluidSimulationMethod_SPH;
desc.mCollisionMethod |= NxOgre::Enums::FluidCollisionMethod_Dynamic;
desc.mCollisionMethod |= NxOgre::Enums::FluidCollisionMethod_Static;
desc.mFlags |= NxOgre::Enums::Fluid:FluidFlags_CollisionTwoWay;
desc.mFlags |= NxOgre::Enums::FluidFlags_Enabled;
desc.mFlags |= NxOgre::Enums::FluidFlags_Hardware;

// with Ogre Particle System
NxOgre::Fluid* mFluid = mRenderSystem->createFluid(desc,"Watermine", Critter::Enums::FluidType_OgreParticle);
Critter::ParticleRenderable* pr = (Critter::ParticleRenderable*)mFluid->getRenderable();
pr->getParticleSystem()->setDefaultDimensions(0.6,2.5);

NxOgre::FluidEmitterDescription edesc;
edesc.mPose.set(953, 450, 2246);
edesc.mPose.set((NxOgre::Quat)Ogre::Quaternion(Degree(90),Ogre::Vector3::UNIT_X));
edesc.mShape = NxOgre::Enums::FluidEmitterShape_Ellipse;
edesc.mParticleLifetime = 25;
edesc.mRate = 2000;
edesc.mFluidSpeed = 100.0f;
edesc.mType = NxOgre::Enums::FluidEmitterType_FlowRate;
edesc.mReplusionCoefficient = 0.0f;
edesc.mDimensionX = 450.00f;
edesc.mDimensionY = 450.00f;

NxOgre::FluidEmitter* mEmitter = mFluid->createEmitter(edesc);


I already change all the variables hundred's times...
But I'm with 3 problems:
1 - I can't do the rain fall more intense.
2 - When particles collide with another, they jump tooooo long.
3 - Later +-25 seconds, appears stacked particles in the air !?

Could someone give an idea...? please :roll:

EDIT: 1 - Solved; 2 - Particially solved (but I still don't know exactly why, just changing properties); 3 - The stacked particles in the air don't have influence of gravity, neither any force/weight (as I saw with showall debugger' function), just appear suddenly.

rromulo

24-07-2011 07:48:16

Anyone please? :(

*I also would love a form to detect collision of particles with the floor/or any other object and change its dimensions/material in this moment...

betajaen

24-07-2011 09:10:34

I really don't think PhysX can do rain.

It's probably easier just to use the Ogre Particle system.

rromulo

24-07-2011 09:33:26

Tks for reply.

But about Ogre Particle System, I probably can't do puddles with it (and this is my objective)...

betajaen

24-07-2011 09:56:31

It's probably better then just create the water at the ground, and mimic the rain using a Ogre based particle system.

Do you mean puddles as in the splashing effect you get? Or actual puddles of water?

rromulo

24-07-2011 11:16:39

It don't need have the splashing effect, would be good but it isn't essencial...

May you specify better when you say "create the water at the ground"?

betajaen

24-07-2011 14:46:44

I meant putting emitters along the ground to create the particles, which would clump together to create the puddles.

rromulo

24-07-2011 22:50:39

Understood, thanks...

Another thing, could you say how to do spherical particles instead of rectangular ones?
I think the effect is better in this form...