T = up_vector * ((temp - ambientTemp) * tempBuoyancy - (massScale * density)) Return vel.x - vel.x + vel.y - vel.yĭef addForces( velocity, temp, density, timeStep, tempBuoyancy, ambientTemp, massScale, vorticity ) Vel = velocity * timeStep / velcity.resolution Velocity = gradientSubtraction(velocity, prevPressure)Ĭolor = advect(velocity, color, timeStep)ĭef advect( velocity, advectTexture, timeStep ) PrevPressure = borderConditions(prevPressure, 1) ![]() PrevPressure = jacobi(prevPressure, div, -1, 4) Velocity = borderConditions(velocity, -1) Velocity = addForces(velocity, temp, density, timeStep, tempBuoyancy, ambientTemp, massScale, vorticity) Velocity = jacobi(velocity, velocity, alpha, alpha + 4) Velocity = advect(velocity, velocity, timeStep)Īlpha = (velocity.resolution^2) / (viscosity * timeStep) # note that, to use "uv" with textures for our GPU implementation, its domain becomes and the vectors that are added to it must be divided by the resolutionĭef FluidSim( velocity, temp, density, color, prevPressure, v_iter, p_iter, timeStep, viscosity, tempBuoyancy, ambientTemp, massScale, vorticity ) # "viscosity", "tempBuoyancy", "ambientTemp", "massScale", "vorticity", and "timeStep" are all floats ![]() ![]() # "v_iter" and "p_iter" are both unsigned integers # "velocity", "temp", "density", "color", and "prevPressure" are clamped arrays/textures
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |