Skip to content

Commit

Permalink
new demo version 0.6.5!
Browse files Browse the repository at this point in the history
  • Loading branch information
rlguy committed Jun 7, 2023
1 parent f353224 commit 398fed7
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 43 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Want to try the FLIP Fluids addon before buying the [full marketplace product](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Official-Marketplaces-of-the-FLIP-Fluids-Addon)? Try out the **FLIP Fluids Demo** addon! The FLIP Fluids demo can do almost everything that the full version can and will let you create, run, and render your own fluid simulations with a few small limitations.
Want to try the FLIP Fluids addon before buying the [full marketplace product](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Official-Marketplaces-of-the-FLIP-Fluids-Addon)? Try out the **FLIP Fluids Demo** addon! The FLIP Fluids demo can do almost everything that the full version can and will let you create, run, and render your own fluid simulations with a few small limitations. The demo version is always up-to-date with the latest features and fixes of the full version.

### Limitations

- Simulation meshes are watermarked with _FLIP Fluids Demo_ text
- Simulation meshes are watermarked with _FLIP Fluids Addon_ text
- Note: the watermark of the demo is baked directly into the simulation meshes. If you install the full version of the addon and load a simulation cache created with the demo version, you will need to re-bake the simulation to remove the watermark.
- The [Mixbox simulated color blending features](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Mixbox-Installation-and-Uninstallation) are not available in this demo. Color blending features will be limited to basic RGB blending methods.
- Supplementary product content such as [[Example Scenes|Example-Scene-Descriptions]] and [Preset Library Scenes](Preset-Library-Installation-and-Uninstallation) will not be available in the demo.

### Getting Started

Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.6.4_demo_(23_may_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.6.3/FLIP_Fluids_addon_0.6.4_demo_.23_may_2023.zip)
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.6.5_demo_(07_jun_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.6.3/FLIP_Fluids_addon_0.6.5_demo_.07_jun_2023.zip)

After downloading the demo addon, follow our [Installation Instructions](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Addon-Installation-and-Uninstallation). The instructions are similar to installing any other Blender addon.

Expand Down
4 changes: 2 additions & 2 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ set(CMAKE_BUILD_TYPE Release)
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD TRUE)
set(FLUIDENGINE_VERSION_MAJOR 0)
set(FLUIDENGINE_VERSION_MINOR 6)
set(FLUIDENGINE_VERSION_REVISION 4)
set(FLUIDENGINE_VERSION_DATE "23-MAY-2023")
set(FLUIDENGINE_VERSION_REVISION 5)
set(FLUIDENGINE_VERSION_DATE "07-JUN-2023")

if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
97 changes: 62 additions & 35 deletions src/engine/fluidsimulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10442,21 +10442,40 @@ void FluidSimulation::_updateSheetSeeding() {
_markerParticles.getAttributeValues("VELOCITY", velocities);

std::vector<float> *ages;
Array3d<float> tempAgeAttributeGrid;
Array3d<bool> tempAgeAttributeValidGrid;
if (_isSurfaceAgeAttributeEnabled) {
tempAgeAttributeGrid = _ageAttributeGrid;
tempAgeAttributeValidGrid = _ageAttributeValidGrid;
_markerParticles.getAttributeValues("AGE", ages);
_updateMarkerParticleAgeAttributeGrid();
_updateMarkerParticleAgeAttributeGrid(tempAgeAttributeGrid, tempAgeAttributeValidGrid);
}

std::vector<float> *viscosities;
Array3d<float> tempViscosityAttributeGrid;
Array3d<bool> tempViscosityAttributeValidGrid;
if (_isSurfaceSourceViscosityAttributeEnabled) {
tempViscosityAttributeGrid = _viscosityAttributeGrid;
tempViscosityAttributeValidGrid = _viscosityAttributeValidGrid;
_markerParticles.getAttributeValues("VISCOSITY", viscosities);
_updateMarkerParticleViscosityAttributeGrid();
_updateMarkerParticleViscosityAttributeGrid(tempViscosityAttributeGrid, tempViscosityAttributeValidGrid);
}

std::vector<vmath::vec3> *colors;
Array3d<float> tempColorAttributeGridR;
Array3d<float> tempColorAttributeGridG;
Array3d<float> tempColorAttributeGridB;
Array3d<bool> tempColorAttributeValidGrid;
if (_isSurfaceSourceColorAttributeEnabled) {
tempColorAttributeGridR = _colorAttributeGridR;
tempColorAttributeGridG = _colorAttributeGridG;
tempColorAttributeGridB = _colorAttributeGridB;
tempColorAttributeValidGrid = _colorAttributeValidGrid;
_markerParticles.getAttributeValues("COLOR", colors);
_updateMarkerParticleColorAttributeGrid();
_updateMarkerParticleColorAttributeGrid(tempColorAttributeGridR,
tempColorAttributeGridG,
tempColorAttributeGridB,
tempColorAttributeValidGrid);
}

vmath::vec3 goffset(0.5f * _dx, 0.5f * _dx, 0.5f * _dx);
Expand All @@ -10483,19 +10502,19 @@ void FluidSimulation::_updateSheetSeeding() {
velocities->push_back(v);

if (_isSurfaceAgeAttributeEnabled) {
float age = Interpolation::trilinearInterpolate(p - goffset, _dx, _ageAttributeGrid);
float age = Interpolation::trilinearInterpolate(p - goffset, _dx, tempAgeAttributeGrid);
ages->push_back(age);
}

if (_isSurfaceSourceViscosityAttributeEnabled) {
float viscosity = Interpolation::trilinearInterpolate(p - goffset, _dx, _viscosityAttributeGrid);
float viscosity = Interpolation::trilinearInterpolate(p - goffset, _dx, tempViscosityAttributeGrid);
viscosities->push_back(viscosity);
}

if (_isSurfaceSourceColorAttributeEnabled) {
float r = Interpolation::trilinearInterpolate(p - goffset, _dx, _colorAttributeGridR);
float g = Interpolation::trilinearInterpolate(p - goffset, _dx, _colorAttributeGridG);
float b = Interpolation::trilinearInterpolate(p - goffset, _dx, _colorAttributeGridB);
float r = Interpolation::trilinearInterpolate(p - goffset, _dx, tempColorAttributeGridR);
float g = Interpolation::trilinearInterpolate(p - goffset, _dx, tempColorAttributeGridG);
float b = Interpolation::trilinearInterpolate(p - goffset, _dx, tempColorAttributeGridB);
vmath::vec3 color(r, g, b);
colors->push_back(color);
}
Expand Down Expand Up @@ -10791,9 +10810,10 @@ void FluidSimulation::_updateMarkerParticleVorticityAttributeGrid() {
}
}

void FluidSimulation::_updateMarkerParticleAgeAttributeGrid() {
_ageAttributeGrid.fill(0.0f);
_ageAttributeValidGrid.fill(false);
void FluidSimulation::_updateMarkerParticleAgeAttributeGrid(Array3d<float> &ageAttributeGrid,
Array3d<bool> &ageAttributeValidGrid) {
ageAttributeGrid.fill(0.0f);
ageAttributeValidGrid.fill(false);

std::vector<vmath::vec3> *positions;
std::vector<float> *ages;
Expand All @@ -10804,20 +10824,21 @@ void FluidSimulation::_updateMarkerParticleAgeAttributeGrid() {
AttributeTransferParameters<float> params;
params.positions = positions;
params.attributes = ages;
params.attributeGrid = &_ageAttributeGrid;
params.validGrid = &_ageAttributeValidGrid;
params.attributeGrid = &ageAttributeGrid;
params.validGrid = &ageAttributeValidGrid;
params.particleRadius = radius;
params.dx = _dx;

AttributeToGridTransfer<float> attributeTransfer;
attributeTransfer.transfer(params);

GridUtils::extrapolateGrid(&_ageAttributeGrid, &_ageAttributeValidGrid, _CFLConditionNumber);
GridUtils::extrapolateGrid(&ageAttributeGrid, &ageAttributeValidGrid, _CFLConditionNumber);
}

void FluidSimulation::_updateMarkerParticleViscosityAttributeGrid() {
_ageAttributeGrid.fill(0.0f);
_ageAttributeValidGrid.fill(false);
void FluidSimulation::_updateMarkerParticleViscosityAttributeGrid(Array3d<float> &viscosityAttributeGrid,
Array3d<bool> &viscosityAttributeValidGrid) {
viscosityAttributeGrid.fill(0.0f);
viscosityAttributeValidGrid.fill(false);

std::vector<vmath::vec3> *positions;
std::vector<float> *viscosities;
Expand All @@ -10828,22 +10849,25 @@ void FluidSimulation::_updateMarkerParticleViscosityAttributeGrid() {
AttributeTransferParameters<float> params;
params.positions = positions;
params.attributes = viscosities;
params.attributeGrid = &_viscosityAttributeGrid;
params.validGrid = &_viscosityAttributeValidGrid;
params.attributeGrid = &viscosityAttributeGrid;
params.validGrid = &viscosityAttributeValidGrid;
params.particleRadius = radius;
params.dx = _dx;

AttributeToGridTransfer<float> attributeTransfer;
attributeTransfer.transfer(params);

GridUtils::extrapolateGrid(&_viscosityAttributeGrid, &_viscosityAttributeValidGrid, _CFLConditionNumber);
GridUtils::extrapolateGrid(&viscosityAttributeGrid, &viscosityAttributeValidGrid, _CFLConditionNumber);
}

void FluidSimulation::_updateMarkerParticleColorAttributeGrid() {
_colorAttributeGridR.fill(0.0f);
_colorAttributeGridG.fill(0.0f);
_colorAttributeGridB.fill(0.0f);
_colorAttributeValidGrid.fill(false);
void FluidSimulation::_updateMarkerParticleColorAttributeGrid(Array3d<float> &colorAttributeGridR,
Array3d<float> &colorAttributeGridG,
Array3d<float> &colorAttributeGridB,
Array3d<bool> &colorAttributeValidGrid) {
colorAttributeGridR.fill(0.0f);
colorAttributeGridG.fill(0.0f);
colorAttributeGridB.fill(0.0f);
colorAttributeValidGrid.fill(false);

Array3d<vmath::vec3> colorAttributeGrid(_isize, _jsize, _ksize, vmath::vec3());

Expand All @@ -10857,7 +10881,7 @@ void FluidSimulation::_updateMarkerParticleColorAttributeGrid() {
params.positions = positions;
params.attributes = colors;
params.attributeGrid = &colorAttributeGrid;
params.validGrid = &_colorAttributeValidGrid;
params.validGrid = &colorAttributeValidGrid;
params.particleRadius = radius;
params.dx = _dx;

Expand All @@ -10871,16 +10895,16 @@ void FluidSimulation::_updateMarkerParticleColorAttributeGrid() {
float rval = _clamp(color.x, 0.0f, 1.0f);
float gval = _clamp(color.y, 0.0f, 1.0f);
float bval = _clamp(color.z, 0.0f, 1.0f);
_colorAttributeGridR.set(i, j, k, rval);
_colorAttributeGridG.set(i, j, k, gval);
_colorAttributeGridB.set(i, j, k, bval);
colorAttributeGridR.set(i, j, k, rval);
colorAttributeGridG.set(i, j, k, gval);
colorAttributeGridB.set(i, j, k, bval);
}
}
}

GridUtils::extrapolateGrid(&_colorAttributeGridR, &_colorAttributeValidGrid, _CFLConditionNumber);
GridUtils::extrapolateGrid(&_colorAttributeGridG, &_colorAttributeValidGrid, _CFLConditionNumber);
GridUtils::extrapolateGrid(&_colorAttributeGridB, &_colorAttributeValidGrid, _CFLConditionNumber);
GridUtils::extrapolateGrid(&colorAttributeGridR, &colorAttributeValidGrid, _CFLConditionNumber);
GridUtils::extrapolateGrid(&colorAttributeGridG, &colorAttributeValidGrid, _CFLConditionNumber);
GridUtils::extrapolateGrid(&colorAttributeGridB, &colorAttributeValidGrid, _CFLConditionNumber);
}

void FluidSimulation::_updateMarkerParticleColorAttributeMixing(double dt) {
Expand Down Expand Up @@ -11115,7 +11139,7 @@ void FluidSimulation::_updateMarkerParticleAgeAttribute(double dt) {
}

if (_currentFrameTimeStepNumber == 0) {
_updateMarkerParticleAgeAttributeGrid();
_updateMarkerParticleAgeAttributeGrid(_ageAttributeGrid, _ageAttributeValidGrid);
}

std::vector<float> *ages;
Expand All @@ -11131,7 +11155,7 @@ void FluidSimulation::_updateMarkerParticleViscosityAttribute() {
}

if (_currentFrameTimeStepNumber == 0) {
_updateMarkerParticleViscosityAttributeGrid();
_updateMarkerParticleViscosityAttributeGrid(_viscosityAttributeGrid, _viscosityAttributeValidGrid);
}
}

Expand All @@ -11141,7 +11165,10 @@ void FluidSimulation::_updateMarkerParticleColorAttribute(double dt) {
}

if (_currentFrameTimeStepNumber == 0) {
_updateMarkerParticleColorAttributeGrid();
_updateMarkerParticleColorAttributeGrid(_colorAttributeGridR,
_colorAttributeGridG,
_colorAttributeGridB,
_colorAttributeValidGrid);
}

_updateMarkerParticleColorAttributeMixing(dt);
Expand Down
11 changes: 8 additions & 3 deletions src/engine/fluidsimulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1689,11 +1689,16 @@ class FluidSimulation
void _updateMarkerParticleVelocityAttributeGrid();
void _updateMarkerParticleVelocityBasedAttributes();
void _updateMarkerParticleVorticityAttributeGrid();
void _updateMarkerParticleAgeAttributeGrid();
void _updateMarkerParticleAgeAttributeGrid(Array3d<float> &ageAttributeGrid,
Array3d<bool> &ageAttributeValidGrid);
void _updateMarkerParticleAgeAttribute(double dt);
void _updateMarkerParticleViscosityAttributeGrid();
void _updateMarkerParticleViscosityAttributeGrid(Array3d<float> &viscosityAttributeGrid,
Array3d<bool> &viscosityAttributeValidGrid);
void _updateMarkerParticleViscosityAttribute();
void _updateMarkerParticleColorAttributeGrid();
void _updateMarkerParticleColorAttributeGrid(Array3d<float> &colorAttributeGridR,
Array3d<float> &colorAttributeGridG,
Array3d<float> &colorAttributeGridB,
Array3d<bool> &colorAttributeValidGrid);
void _updateMarkerParticleColorAttributeMixing(double dt);
vmath::vec3 _RGBToHSV(vmath::vec3 in);
vmath::vec3 _HSVToRGB(vmath::vec3 in);
Expand Down

0 comments on commit 398fed7

Please sign in to comment.