13 std::shared_ptr<ProgramFactory>
const& factory,
14 int xSize,
int ySize,
float dt,
float densityViscosity,
float velocityViscosity)
23 float dx = 1.0f/
static_cast<float>(
mXSize);
24 float dy = 1.0f/
static_cast<float>(
mYSize);
25 float dtDivDxDx = (dt/dx)/dx;
26 float dtDivDyDy = (dt/dy)/dy;
28 float ratioSqr = ratio*ratio;
29 float factor = 0.5f/(1.0f + ratioSqr);
30 float epsilonX = factor;
31 float epsilonY = ratioSqr*factor;
32 float epsilon0 = dx*dx*factor;
33 float denVX = densityViscosity*dtDivDxDx;
34 float denVY = densityViscosity*dtDivDyDy;
35 float velVX = velocityViscosity*dtDivDxDx;
36 float velVY = velocityViscosity*dtDivDyDy;
42 p.
timeDelta = { dt / dx, dt / dy, 0.0f, dt };
45 p.
epsilon = { epsilonX, epsilonY, 0.0f, epsilon0 };
std::shared_ptr< Texture2 > mStateTp1Texture
Vector4< float > viscosityY
Vector4< float > spaceDelta
std::shared_ptr< Fluid2ComputeDivergence > mComputeDivergence
std::shared_ptr< Fluid2UpdateState > mUpdateState
std::shared_ptr< Texture2 > mStateTTexture
Fluid2(std::shared_ptr< GraphicsEngine > const &engine, std::shared_ptr< ProgramFactory > const &factory, int xSize, int ySize, float dt, float densityViscosity, float velocityViscosity)
std::shared_ptr< Fluid2SolvePoisson > mSolvePoisson
std::shared_ptr< Texture2 > mDivergenceTexture
Vector4< float > halfDivDelta
std::shared_ptr< Fluid2InitializeState > mInitializeState
std::shared_ptr< Texture2 > mSourceTexture
std::shared_ptr< Fluid2AdjustVelocity > mAdjustVelocity
std::shared_ptr< Texture2 > mPoissonTexture
Vector4< float > viscosityX
std::shared_ptr< Fluid2InitializeSource > mInitializeSource
std::shared_ptr< GraphicsEngine > mEngine
std::shared_ptr< Fluid2EnforceStateBoundary > mEnforceStateBoundary
std::shared_ptr< Texture2 > mStateTm1Texture
std::shared_ptr< ConstantBuffer > mParameters
Vector4< float > timeDelta