77 #define DT_DEFAULT 0.1f
80 #define PHI_MAX 9999.0f
100 # define ADD_IF_LOWER_POS(a, b) (min_ff((a) + (b), max_ff((a), (b))))
101 # define ADD_IF_LOWER_NEG(a, b) (max_ff((a) + (b), min_ff((a), (b))))
102 # define ADD_IF_LOWER(a, b) (((b) > 0) ? ADD_IF_LOWER_POS((a), (b)) : ADD_IF_LOWER_NEG((a), (b)))
106 if (free_old && fds->
fluid) {
109 if (!
min_iii(res[0], res[1], res[2])) {
134 int new_shift[3] = {0};
140 int o_total_cells = o_res[0] * o_res[1] * o_res[2];
141 int n_total_cells = n_res[0] * n_res[1] * n_res[2];
144 if (o_total_cells > 1 && n_total_cells > 1) {
201 for (
int z = o_min[2];
z < o_max[2];
z++) {
202 for (
int y = o_min[1];
y < o_max[1];
y++) {
203 for (
int x = o_min[0];
x < o_max[0];
x++) {
205 int xo =
x - o_min[0];
206 int yo =
y - o_min[1];
207 int zo =
z - o_min[2];
210 int xn =
x - n_min[0] - new_shift[0];
211 int yn =
y - n_min[1] - new_shift[1];
212 int zn =
z - n_min[2] - new_shift[2];
216 if (xn < 0 || xn >= n_res[0] || yn < 0 || yn >= n_res[1] || zn < 0 || zn >= n_res[2]) {
230 if (xo < bwidth || yo < bwidth || zo < bwidth || xo >= o_res[0] - bwidth ||
231 yo >= o_res[1] - bwidth || zo >= o_res[2] - bwidth) {
235 if (xn < bwidth || yn < bwidth || zn < bwidth || xn >= n_res[0] - bwidth ||
236 yn >= n_res[1] - bwidth || zn >= n_res[2] - bwidth) {
245 int xx_o = xo * block_size;
246 int yy_o = yo * block_size;
247 int zz_o = zo * block_size;
249 int xx_n = xn * block_size;
250 int yy_n = yn * block_size;
251 int zz_n = zn * block_size;
254 n_wt_tcu[index_new] = o_wt_tcu[index_old];
255 n_wt_tcv[index_new] = o_wt_tcv[index_old];
256 n_wt_tcw[index_new] = o_wt_tcw[index_old];
258 n_wt_tcu2[index_new] = o_wt_tcu2[index_old];
259 n_wt_tcv2[index_new] = o_wt_tcv2[index_old];
260 n_wt_tcw2[index_new] = o_wt_tcw2[index_old];
262 for (i = 0; i < block_size; i++) {
263 for (j = 0; j < block_size; j++) {
264 for (k = 0; k < block_size; k++) {
266 xx_o + i, wt_res_old[0], yy_o + j, wt_res_old[1], zz_o + k);
270 n_wt_dens[big_index_new] = o_wt_dens[big_index_old];
271 if (n_wt_flame && o_wt_flame) {
272 n_wt_flame[big_index_new] = o_wt_flame[big_index_old];
273 n_wt_fuel[big_index_new] = o_wt_fuel[big_index_old];
274 n_wt_react[big_index_new] = o_wt_react[big_index_old];
276 if (n_wt_r && o_wt_r) {
277 n_wt_r[big_index_new] = o_wt_r[big_index_old];
278 n_wt_g[big_index_new] = o_wt_g[big_index_old];
279 n_wt_b[big_index_new] = o_wt_b[big_index_old];
286 n_dens[index_new] = o_dens[index_old];
288 if (n_heat && o_heat) {
289 n_heat[index_new] = o_heat[index_old];
292 if (n_fuel && o_fuel) {
293 n_flame[index_new] = o_flame[index_old];
294 n_fuel[index_new] = o_fuel[index_old];
295 n_react[index_new] = o_react[index_old];
299 n_r[index_new] = o_r[index_old];
300 n_g[index_new] = o_g[index_old];
301 n_b[index_new] = o_b[index_old];
303 n_vx[index_new] = o_vx[index_old];
304 n_vy[index_new] = o_vy[index_old];
305 n_vz[index_new] = o_vz[index_old];
401 bool init_resolution)
404 float min[3] = {FLT_MAX, FLT_MAX, FLT_MAX},
max[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX};
413 for (i = 0; i < me->
totvert; i++) {
420 fds->
dx = 1.0f / res;
424 if (init_resolution) {
429 for (i = 0; i < 3; i++) {
438 if (!init_resolution || (
size[0] < FLT_EPSILON) || (
size[1] < FLT_EPSILON) ||
439 (
size[2] < FLT_EPSILON)) {
445 scale = res /
size[0];
452 scale = res /
size[1];
459 scale = res /
size[2];
483 static bool BKE_fluid_modifier_init(
492 manta_set_domain_from_mesh(fds, ob, me,
true);
494 update_final_gravity(fds,
scene);
506 res[0] = res[1] = res[2] = 1;
522 fmd->
time = scene_framenr;
531 fmd->
time = scene_framenr;
538 fmd->
time = scene_framenr;
546 static float calc_voxel_transp(
547 float *
result,
const float *
input,
int res[3],
int *pixel,
float *t_ray,
float correct);
548 static void update_distances(
int index,
551 const float ray_start[3],
552 float surface_thickness,
553 bool use_plane_init);
555 static int get_light(
ViewLayer *view_layer,
float *light)
561 for (base_tmp =
FIRSTBASE(view_layer); base_tmp; base_tmp = base_tmp->
next) {
582 const float *min_vel,
583 const float *max_vel,
587 for (
int i = 0; i < 3; i++) {
594 if (min_vel && min_vel[i] < 0.0f) {
595 min[i] += (int)
floor(min_vel[i] * dt);
597 if (max_vel && max_vel[i] > 0.0f) {
598 max[i] += (int)
ceil(max_vel[i] * dt);
607 static bool is_static_object(
Object *ob)
612 for (; md; md = md->
next) {
640 typedef struct FluidObjectBB {
645 int min[3],
max[3], res[3];
646 int hmin[3], hmax[3], hres[3];
647 int total_cells, valid;
650 static void bb_boundInsert(FluidObjectBB *bb,
const float point[3])
662 if (
point[i] < bb->min[i]) {
665 if (
point[i] > bb->max[i]) {
672 static void bb_allocateData(FluidObjectBB *bb,
bool use_velocity,
bool use_influence)
676 for (i = 0; i < 3; i++) {
677 res[i] = bb->max[i] - bb->min[i];
682 bb->total_cells = res[0] * res[1] * res[2];
685 bb->numobjs =
MEM_calloc_arrayN(bb->total_cells,
sizeof(
float),
"fluid_bb_numobjs");
687 bb->influence =
MEM_calloc_arrayN(bb->total_cells,
sizeof(
float),
"fluid_bb_influence");
690 bb->velocity =
MEM_calloc_arrayN(bb->total_cells,
sizeof(
float[3]),
"fluid_bb_velocity");
693 bb->distances =
MEM_malloc_arrayN(bb->total_cells,
sizeof(
float),
"fluid_bb_distances");
694 copy_vn_fl(bb->distances, bb->total_cells, FLT_MAX);
699 static void bb_freeData(FluidObjectBB *bb)
715 static void bb_combineMaps(FluidObjectBB *
output,
724 memcpy(&bb1,
output,
sizeof(FluidObjectBB));
725 memset(
output, 0,
sizeof(FluidObjectBB));
727 for (i = 0; i < 3; i++) {
729 output->min[i] =
MIN2(bb1.min[i], bb2->min[i]);
730 output->max[i] =
MAX2(bb1.max[i], bb2->max[i]);
733 output->min[i] = bb2->min[i];
734 output->max[i] = bb2->max[i];
738 bb_allocateData(
output, (bb1.velocity || bb2->velocity), (bb1.influence || bb2->influence));
741 for (
x =
output->min[0]; x < output->
max[0];
x++) {
742 for (
y =
output->min[1]; y < output->
max[1];
y++) {
743 for (
z =
output->min[2]; z < output->
max[2];
z++) {
751 if (
x >= bb1.min[0] &&
x < bb1.max[0] &&
y >= bb1.min[1] &&
y < bb1.max[1] &&
752 z >= bb1.min[2] &&
z < bb1.max[2]) {
754 x - bb1.min[0], bb1.res[0],
y - bb1.min[1], bb1.res[1],
z - bb1.min[2]);
757 output->numobjs[index_out] = bb1.numobjs[index_in];
758 if (
output->influence && bb1.influence) {
759 output->influence[index_out] = bb1.influence[index_in];
761 output->distances[index_out] = bb1.distances[index_in];
762 if (
output->velocity && bb1.velocity) {
768 if (
x >= bb2->min[0] && x < bb2->
max[0] &&
y >= bb2->min[1] && y < bb2->
max[1] &&
769 z >= bb2->min[2] && z < bb2->
max[2]) {
771 x - bb2->min[0], bb2->res[0],
y - bb2->min[1], bb2->res[1],
z - bb2->min[2]);
774 output->numobjs[index_out] =
MAX2(bb2->numobjs[index_in],
output->numobjs[index_out]);
775 if (
output->influence && bb2->influence) {
777 output->influence[index_out] += bb2->influence[index_in] * sample_size;
780 output->influence[index_out] =
MAX2(bb2->influence[index_in],
781 output->influence[index_out]);
784 output->distances[index_out] =
MIN2(bb2->distances[index_in],
785 output->distances[index_out]);
786 if (
output->velocity && bb2->velocity) {
788 output->velocity[index_out * 3] = ADD_IF_LOWER(
output->velocity[index_out * 3],
789 bb2->velocity[index_in * 3]);
790 output->velocity[index_out * 3 + 1] = ADD_IF_LOWER(
output->velocity[index_out * 3 + 1],
791 bb2->velocity[index_in * 3 + 1]);
792 output->velocity[index_out * 3 + 2] = ADD_IF_LOWER(
output->velocity[index_out * 3 + 2],
793 bb2->velocity[index_in * 3 + 2]);
812 float src_distance_value,
814 float src_numobjs_value,
816 float const src_vel_value[3],
823 dest_phi_in[index] =
MIN2(src_distance_value, dest_phi_in[index]);
827 if (dest_numobjs && src_numobjs_value > 0) {
828 dest_numobjs[index] += 1;
832 if (dest_vel_x && src_numobjs_value > 0) {
833 dest_vel_x[index] += src_vel_value[0];
834 dest_vel_y[index] += src_vel_value[1];
835 dest_vel_z[index] += src_vel_value[2];
846 const float ray_start[3],
847 const float *vert_vel,
856 const float surface_distance = 1.732;
857 nearest.
dist_sq = surface_distance * surface_distance;
867 v1 = mloop[mlooptri[f_index].
tri[0]].
v;
868 v2 = mloop[mlooptri[f_index].
tri[1]].
v;
869 v3 = mloop[mlooptri[f_index].
tri[2]].
v;
881 float abs_hit_vel[3];
887 copy_v3_v3(abs_vel, &velocity_map[index * 3]);
892 velocity_map[index * 3] = (velocity_map[index * 3] + hit_vel[0]) * 0.5f;
893 velocity_map[index * 3 + 1] = (velocity_map[index * 3 + 1] + hit_vel[1]) * 0.5f;
894 velocity_map[index * 3 + 2] = (velocity_map[index * 3 + 2] + hit_vel[2]) * 0.5f;
897 velocity_map[index * 3] = hit_vel[0];
898 velocity_map[index * 3 + 1] = hit_vel[1];
899 velocity_map[index * 3 + 2] = hit_vel[2];
902 velocity_map[index * 3] =
MIN2(abs_hit_vel[0], abs_vel[0]);
903 velocity_map[index * 3 + 1] =
MIN2(abs_hit_vel[1], abs_vel[1]);
904 velocity_map[index * 3 + 2] =
MIN2(abs_hit_vel[2], abs_vel[2]);
908 velocity_map[index * 3] =
MAX2(abs_hit_vel[0], abs_vel[0]);
909 velocity_map[index * 3 + 1] =
MAX2(abs_hit_vel[1], abs_vel[1]);
910 velocity_map[index * 3 + 2] =
MAX2(abs_hit_vel[2], abs_vel[2]);
915 velocity_map[index * 3] = hit_vel[0];
916 velocity_map[index * 3 + 1] = hit_vel[1];
917 velocity_map[index * 3 + 2] = hit_vel[2];
920 printf(
"setting effector object vel: [%f, %f, %f]\n", hit_vel[0], hit_vel[1], hit_vel[2]);
934 typedef struct ObstaclesFromDMData {
947 } ObstaclesFromDMData;
949 static void obstacles_from_mesh_task_cb(
void *__restrict userdata,
953 ObstaclesFromDMData *
data = userdata;
954 FluidObjectBB *bb =
data->bb;
956 for (
int x =
data->min[0]; x < data->
max[0];
x++) {
957 for (
int y =
data->min[1]; y < data->
max[1];
y++) {
959 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
960 const float ray_start[3] = {(
float)
x + 0.5f, (
float)
y + 0.5f, (
float)
z + 0.5f};
963 update_distances(index,
967 data->fes->surface_distance,
983 if (bb->distances[index] < 0) {
984 bb->numobjs[index]++;
990 static void obstacles_from_mesh(
Object *coll_ob,
1004 float *vert_vel =
NULL;
1005 bool has_velocity =
false;
1009 int min[3],
max[3], res[3];
1024 vert_vel =
MEM_callocN(
sizeof(
float[3]) * numverts,
"manta_obs_velocity");
1035 has_velocity =
true;
1041 for (i = 0; i < numverts; i++) {
1046 manta_pos_to_cell(fds, mvert[i].co);
1057 bb_boundInsert(bb, mvert[i].co);
1062 int bounds_margin = (int)
ceil(5.196);
1063 clamp_bounds_in_domain(fds, bb->min, bb->max,
NULL,
NULL, bounds_margin, dt);
1064 bb_allocateData(bb,
true,
false);
1067 for (i = 0; i < 3; i++) {
1068 min[i] = bb->min[i];
1069 max[i] = bb->max[i];
1070 res[i] = bb->res[i];
1077 ObstaclesFromDMData
data = {
1081 .mlooptri = looptri,
1084 .has_velocity = has_velocity,
1085 .vert_vel = vert_vel,
1122 int coll_ob_array_len)
1129 active_fields &= ~prev_flags;
1132 for (coll_index = 0; coll_index < coll_ob_array_len; coll_index++) {
1133 Object *coll_ob = coll_ob_array[coll_index];
1162 static bool escape_effectorobject(
Object *flowobj,
1167 bool is_static = is_static_object(flowobj);
1179 if (is_static && !is_first_frame && !is_resume) {
1185 static void compute_obstaclesemission(
Scene *
scene,
1186 FluidObjectBB *bb_maps,
1194 float time_per_frame)
1199 for (
int effec_index = 0; effec_index < numeffecobjs; effec_index++) {
1200 Object *effecobj = effecobjs[effec_index];
1213 FluidObjectBB *bb = &bb_maps[effec_index];
1216 if (escape_effectorobject(effecobj, fds, fes, frame)) {
1222 if (is_first_frame) {
1227 float sample_size = 1.0f / (
float)(subframes + 1);
1228 float subframe_dt = dt * sample_size;
1231 for (
int subframe = 0; subframe <= subframes; subframe++) {
1234 FluidObjectBB bb_temp = {
NULL};
1238 if ((subframe < subframes || time_per_frame + dt + FLT_EPSILON < frame_length) &&
1240 scene->
r.
subframe = (time_per_frame + (subframe + 1.0f) * subframe_dt) / frame_length;
1252 "effector: frame (is first: %d): %d // scene current frame: %d // scene current "
1268 obstacles_from_mesh(effecobj, fds, fes, &bb_temp, subframe_dt);
1271 obstacles_from_mesh(effecobj, fds, fes, bb, subframe_dt);
1278 bb_combineMaps(bb, &bb_temp, 0, 0.0f);
1279 bb_freeData(&bb_temp);
1290 float time_per_frame,
1295 FluidObjectBB *bb_maps =
NULL;
1297 uint numeffecobjs = 0;
1305 update_obstacleflags(fds, effecobjs, numeffecobjs);
1306 ensure_obstaclefields(fds);
1309 bb_maps =
MEM_callocN(
sizeof(
struct FluidObjectBB) * numeffecobjs,
"fluid_effector_bb_maps");
1312 compute_obstaclesemission(
scene,
1339 for (
z = 0;
z < fds->
res[0] * fds->
res[1] * fds->
res[2];
z++) {
1347 if (phi_obsstatic_in && (is_first_frame || use_adaptivedomain)) {
1353 if (num_obstacles) {
1354 num_obstacles[
z] = 0;
1359 if (vel_x && vel_y && vel_z) {
1364 if (vel_x_guide && vel_y_guide && vel_z_guide) {
1365 vel_x_guide[
z] = 0.0f;
1366 vel_y_guide[
z] = 0.0f;
1367 vel_z_guide[
z] = 0.0f;
1372 for (
int effec_index = 0; effec_index < numeffecobjs; effec_index++) {
1373 Object *effecobj = effecobjs[effec_index];
1385 bool is_static = is_static_object(effecobj) && !use_adaptivedomain;
1396 FluidObjectBB *bb = &bb_maps[effec_index];
1397 float *velocity_map = bb->velocity;
1398 float *numobjs_map = bb->numobjs;
1399 float *distance_map = bb->distances;
1401 int gx, gy, gz, ex, ey, ez, dx, dy, dz;
1402 size_t e_index, d_index;
1405 for (gx = bb->min[0]; gx < bb->
max[0]; gx++) {
1406 for (gy = bb->min[1]; gy < bb->
max[1]; gy++) {
1407 for (gz = bb->min[2]; gz < bb->
max[2]; gz++) {
1409 ex = gx - bb->min[0];
1410 ey = gy - bb->min[1];
1411 ez = gz - bb->min[2];
1420 if (dx < 0 || dy < 0 || dz < 0 || dx >= fds->
res[0] || dy >= fds->
res[1] ||
1421 dz >= fds->
res[2]) {
1426 float *levelset = ((is_first_frame || is_resume) && is_static) ? phi_obsstatic_in :
1428 apply_effector_fields(fes,
1430 distance_map[e_index],
1432 numobjs_map[e_index],
1434 &velocity_map[e_index * 3],
1440 apply_effector_fields(fes,
1442 distance_map[e_index],
1444 numobjs_map[e_index],
1446 &velocity_map[e_index * 3],
1470 typedef struct EmitFromParticlesData {
1475 float *particle_vel;
1480 } EmitFromParticlesData;
1482 static void emit_from_particles_task_cb(
void *__restrict userdata,
1486 EmitFromParticlesData *
data = userdata;
1488 FluidObjectBB *bb =
data->bb;
1490 for (
int x =
data->min[0]; x < data->
max[0];
x++) {
1491 for (
int y =
data->min[1]; y < data->
max[1];
y++) {
1493 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
1494 const float ray_start[3] = {((
float)
x) + 0.5f, ((
float)
y) + 0.5f, ((
float)
z) + 0.5f};
1497 KDTreeNearest_3d nearest;
1498 const float range =
data->solid +
data->smooth;
1499 BLI_kdtree_3d_find_nearest(
data->tree, ray_start, &nearest);
1501 if (nearest.dist < range) {
1502 bb->influence[index] = (nearest.dist <
data->solid) ?
1504 (1.0f - (nearest.dist -
data->solid) /
data->smooth);
1508 &bb->velocity[index * 3], &
data->particle_vel[nearest.index * 3], ffs->
vel_multi);
1515 static void emit_from_particles(
Object *flow_ob,
1528 float *particle_pos;
1529 float *particle_vel;
1530 int totpart = psys->
totpart, totchild;
1532 int valid_particles = 0;
1533 int bounds_margin = 1;
1537 const float smooth = 0.5f;
1556 particle_pos =
MEM_callocN(
sizeof(
float[3]) * (totpart + totchild),
1557 "manta_flow_particles_pos");
1558 particle_vel =
MEM_callocN(
sizeof(
float[3]) * (totpart + totchild),
1559 "manta_flow_particles_vel");
1568 for (p = 0; p < totpart + totchild; p++) {
1592 pos = &particle_pos[valid_particles * 3];
1594 manta_pos_to_cell(fds,
pos);
1597 vel = &particle_vel[valid_particles * 3];
1602 BLI_kdtree_3d_insert(
tree, valid_particles,
pos);
1606 bb_boundInsert(bb,
pos);
1611 clamp_bounds_in_domain(fds, bb->min, bb->max,
NULL,
NULL, bounds_margin, dt);
1615 for (p = 0; p < valid_particles; p++) {
1622 cell[0] =
floor(particle_pos[p * 3]) - bb->min[0];
1623 cell[1] =
floor(particle_pos[p * 3 + 1]) - bb->min[1];
1624 cell[2] =
floor(particle_pos[p * 3 + 2]) - bb->min[2];
1626 for (i = 0; i < 3; i++) {
1627 if ((cell[i] > bb->res[i] - 1) || (cell[i] < 0)) {
1636 index =
manta_get_index(cell[0], bb->res[0], cell[1], bb->res[1], cell[2]);
1638 bb->influence[index] = 1.0f;
1645 else if (valid_particles > 0) {
1646 int min[3],
max[3], res[3];
1649 for (
int i = 0; i < 3; i++) {
1650 min[i] = bb->min[i];
1651 max[i] = bb->max[i];
1652 res[i] = bb->res[i];
1655 BLI_kdtree_3d_balance(
tree);
1657 EmitFromParticlesData
data = {
1661 .particle_vel = particle_vel,
1676 BLI_kdtree_3d_free(
tree);
1693 static void update_distances(
int index,
1694 float *distance_map,
1696 const float ray_start[3],
1697 float surface_thickness,
1698 bool use_plane_init)
1703 if (use_plane_init) {
1709 const float surface_distance = 1.732;
1710 nearest.
dist_sq = surface_distance *
1714 if (surface_thickness) {
1715 nearest.
dist_sq += surface_thickness;
1723 min_dist = (-1.0f) *
fabsf(min_dist);
1730 float ray_dirs[26][3] = {
1731 {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {-1.0f, 0.0f, 0.0f},
1732 {0.0f, -1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f, 0.0f}, {1.0f, -1.0f, 0.0f},
1733 {-1.0f, 1.0f, 0.0f}, {-1.0f, -1.0f, 0.0f}, {1.0f, 0.0f, 1.0f}, {1.0f, 0.0f, -1.0f},
1734 {-1.0f, 0.0f, 1.0f}, {-1.0f, 0.0f, -1.0f}, {0.0f, 1.0f, 1.0f}, {0.0f, 1.0f, -1.0f},
1735 {0.0f, -1.0f, 1.0f}, {0.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {1.0f, -1.0f, 1.0f},
1736 {-1.0f, 1.0f, 1.0f}, {-1.0f, -1.0f, 1.0f}, {1.0f, 1.0f, -1.0f}, {1.0f, -1.0f, -1.0f},
1737 {-1.0f, 1.0f, -1.0f}, {-1.0f, -1.0f, -1.0f}};
1742 int miss_count = 0, dir_count = 0;
1744 for (
int i = 0; i <
ARRAY_SIZE(ray_dirs); i++) {
1746 hit_tree.
index = -1;
1760 if (hit_tree.
index == -1) {
1767 if (
dot_v3v3(ray_dirs[i], hit_tree.
no) <= 0) {
1771 if (hit_tree.
dist < min_dist) {
1772 min_dist = hit_tree.
dist;
1778 if (!(miss_count > 0 || dir_count ==
ARRAY_SIZE(ray_dirs))) {
1779 min_dist = (-1.0f) *
fabsf(min_dist);
1783 if (surface_thickness) {
1784 min_dist -= surface_thickness;
1789 distance_map[index] =
MIN2(distance_map[index], min_dist);
1797 const float (*vert_normals)[3],
1801 float *influence_map,
1802 float *velocity_map,
1804 const int base_res[3],
1806 const float flow_center[3],
1808 const float ray_start[3],
1809 const float *vert_vel,
1817 float ray_dir[3] = {1.0f, 0.0f, 0.0f};
1821 float volume_factor = 0.0f;
1830 const float surface_distance = 1.732;
1831 nearest.
dist_sq = surface_distance * surface_distance;
1833 bool is_gas_flow =
ELEM(
1839 float emission_strength = (is_gas_flow) ? 0.0f : 1.0f;
1850 float dot = ray_dir[0] * hit.
no[0] + ray_dir[1] * hit.
no[1] + ray_dir[2] * hit.
no[2];
1866 if (hit.
index != -1) {
1877 int v1,
v2, v3, f_index = nearest.
index;
1878 float hit_normal[3];
1881 v1 = mloop[mlooptri[f_index].
tri[0]].
v;
1882 v2 = mloop[mlooptri[f_index].
tri[1]].
v;
1883 v3 = mloop[mlooptri[f_index].
tri[2]].
v;
1891 CLAMP(emission_strength, 0.0f, 1.0f);
1892 emission_strength =
pow(1.0f - emission_strength, 0.5f);
1895 emission_strength = 0.0f;
1899 if (defgrp_index != -1 && dvert) {
1903 emission_strength *= weight_mask;
1908 float tex_co[3] = {0};
1912 tex_co[0] = ((
x - flow_center[0]) / base_res[0]) / ffs->
texture_size;
1913 tex_co[1] = ((
y - flow_center[1]) / base_res[1]) / ffs->
texture_size;
1914 tex_co[2] = ((
z - flow_center[2]) / base_res[2] - ffs->
texture_offset) /
1919 uv[0] = mloopuv[mlooptri[f_index].
tri[0]].
uv;
1920 uv[1] = mloopuv[mlooptri[f_index].
tri[1]].
uv;
1921 uv[2] = mloopuv[mlooptri[f_index].
tri[2]].
uv;
1926 tex_co[0] = tex_co[0] * 2.0f - 1.0f;
1927 tex_co[1] = tex_co[1] * 2.0f - 1.0f;
1931 emission_strength *= texres.
tin;
1941 hit_normal, vert_normals[
v1], vert_normals[
v2], vert_normals[v3], weights);
1945 velocity_map[index * 3] += hit_normal[0] * ffs->
vel_normal;
1946 velocity_map[index * 3 + 1] += hit_normal[1] * ffs->
vel_normal;
1947 velocity_map[index * 3 + 2] += hit_normal[2] * ffs->
vel_normal;
1953 hit_vel, &vert_vel[
v1 * 3], &vert_vel[
v2 * 3], &vert_vel[v3 * 3], weights);
1954 velocity_map[index * 3] += hit_vel[0] * ffs->
vel_multi;
1955 velocity_map[index * 3 + 1] += hit_vel[1] * ffs->
vel_multi;
1956 velocity_map[index * 3 + 2] += hit_vel[2] * ffs->
vel_multi;
1959 printf(
"adding flow object vel: [%f, %f, %f]\n", hit_vel[0], hit_vel[1], hit_vel[2]);
1963 float convert_vel[3];
1965 float time_mult = 1.0 / (25.0f *
DT_DEFAULT);
1966 float size_mult =
MAX3(base_res[0], base_res[1], base_res[2]) /
1970 velocity_map[index * 3] += convert_vel[0];
1971 velocity_map[index * 3 + 1] += convert_vel[1];
1972 velocity_map[index * 3 + 2] += convert_vel[2];
1974 printf(
"initial vel: [%f, %f, %f]\n",
1975 velocity_map[index * 3],
1976 velocity_map[index * 3 + 1],
1977 velocity_map[index * 3 + 2]);
1983 influence_map[index] =
MAX2(volume_factor, emission_strength);
1986 typedef struct EmitFromDMData {
1991 const float (*vert_normals)[3];
2007 static void emit_from_mesh_task_cb(
void *__restrict userdata,
2011 EmitFromDMData *
data = userdata;
2012 FluidObjectBB *bb =
data->bb;
2014 for (
int x =
data->min[0]; x < data->
max[0];
x++) {
2015 for (
int y =
data->min[1]; y < data->
max[1];
y++) {
2017 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
2018 const float ray_start[3] = {((
float)
x) + 0.5f, ((
float)
y) + 0.5f, ((
float)
z) + 0.5f};
2023 sample_mesh(
data->ffs,
2032 data->fds->base_res,
2033 data->fds->global_size,
2047 update_distances(index,
2051 data->ffs->surface_distance,
2057 static void emit_from_mesh(
2064 float *vert_vel =
NULL;
2065 bool has_velocity =
false;
2068 float flow_center[3] = {0};
2069 int min[3],
max[3], res[3];
2084 const int numverts = me->
totvert;
2089 vert_vel =
MEM_callocN(
sizeof(
float[3]) * numverts,
"manta_flow_velocity");
2099 has_velocity =
true;
2107 for (i = 0; i < numverts; i++) {
2110 manta_pos_to_cell(fds, mvert[i].co);
2129 bb_boundInsert(bb, mvert[i].co);
2132 manta_pos_to_cell(fds, flow_center);
2136 int bounds_margin = (int)
ceil(5.196);
2137 clamp_bounds_in_domain(fds, bb->min, bb->max,
NULL,
NULL, bounds_margin, dt);
2141 for (i = 0; i < 3; i++) {
2142 min[i] = bb->min[i];
2143 max[i] = bb->max[i];
2144 res[i] = bb->res[i];
2151 EmitFromDMData
data = {
2155 .vert_normals = vert_normals,
2157 .mlooptri = mlooptri,
2160 .defgrp_index = defgrp_index,
2163 .has_velocity = has_velocity,
2164 .vert_vel = vert_vel,
2165 .flow_center = flow_center,
2195 static void adaptive_domain_adjust(
2199 int new_shift[3] = {0};
2201 float frame_shift_f[3];
2202 float ob_loc[3] = {0};
2210 frame_shift_f[0] = frame_shift_f[0] / fds->
cell_size[0];
2211 frame_shift_f[1] = frame_shift_f[1] / fds->
cell_size[1];
2212 frame_shift_f[2] = frame_shift_f[2] / fds->
cell_size[2];
2234 int min[3] = {32767, 32767, 32767},
max[3] = {-32767, -32767, -32767}, res[3];
2235 int total_cells = 1, res_changed = 0, shift_changed = 0;
2236 float min_vel[3], max_vel[3];
2254 for (
x = fds->
res_min[0]; x < fds->res_max[0];
x++) {
2255 for (
y = fds->
res_min[1]; y < fds->res_max[1];
y++) {
2256 for (
z = fds->
res_min[2]; z < fds->res_max[2];
z++) {
2257 int xn =
x - new_shift[0];
2258 int yn =
y - new_shift[1];
2259 int zn =
z - new_shift[2];
2264 if (xn >=
min[0] && xn <=
max[0] && yn >=
min[1] && yn <=
max[1] && zn >=
min[2] &&
2280 int xx = (
x - fds->
res_min[0]) * block_size;
2281 int yy = (
y - fds->
res_min[1]) * block_size;
2282 int zz = (
z - fds->
res_min[2]) * block_size;
2284 for (i = 0; i < block_size; i++) {
2285 for (j = 0; j < block_size; j++) {
2286 for (k = 0; k < block_size; k++) {
2287 int big_index =
manta_get_index(xx + i, wt_res[0], yy + j, wt_res[1], zz + k);
2288 float den = (bigfuel) ?
MAX2(bigdensity[big_index], bigfuel[big_index]) :
2289 bigdensity[big_index];
2290 if (den > max_den) {
2321 if (min_vel[0] > vx[index]) {
2322 min_vel[0] = vx[index];
2324 if (min_vel[1] > vy[index]) {
2325 min_vel[1] = vy[index];
2327 if (min_vel[2] > vz[index]) {
2328 min_vel[2] = vz[index];
2330 if (max_vel[0] < vx[index]) {
2331 max_vel[0] = vx[index];
2333 if (max_vel[1] < vy[index]) {
2334 max_vel[1] = vy[index];
2336 if (max_vel[2] < vz[index]) {
2337 max_vel[2] = vz[index];
2344 for (
int i = 0; i < numflowobj; i++) {
2345 FluidObjectBB *bb = &bb_maps[i];
2347 for (
x = bb->min[0]; x < bb->
max[0];
x++) {
2348 for (
y = bb->min[1]; y < bb->
max[1];
y++) {
2349 for (
z = bb->min[2]; z < bb->
max[2];
z++) {
2351 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
2352 float max_den = bb->influence[index];
2383 for (
int i = 0; i < 3; i++) {
2385 res[i] =
max[i] -
min[i];
2386 total_cells *= res[i];
2395 for (j = 0; j < 3; j++) {
2409 if (res_changed || shift_changed) {
2424 BLI_INLINE void apply_outflow_fields(
int index,
2425 float distance_value,
2438 phiout[index] =
MIN2(distance_value, phiout[index]);
2450 react[index] = 0.0f;
2453 color_r[index] = 0.0f;
2454 color_g[index] = 0.0f;
2455 color_b[index] = 0.0f;
2460 float emission_value,
2461 float distance_value,
2472 const float *color_r,
2474 const float *color_g,
2476 const float *color_b,
2483 phi_in[index] =
MIN2(distance_value, phi_in[index]);
2489 emission_in[index] =
MAX2(emission_value, emission_in[index]);
2497 float fuel_flow = (fuel) ? emission_value * ffs->
fuel_amount : 0.0f;
2499 if (heat && heat_in) {
2500 if (emission_value > 0.0f) {
2501 heat_in[index] = ADD_IF_LOWER(heat[index], ffs->
temperature);
2506 if (absolute_flow) {
2510 density_in[index] =
MAX2(dens_flow, density_in[index]);
2513 if (fuel && fuel_in) {
2516 fuel_in[index] =
MAX2(fuel_flow, fuel_in[index]);
2524 density_in[index] += dens_flow;
2525 CLAMP(density_in[index], 0.0f, 1.0f);
2528 if (fuel && fuel_in) {
2530 fuel_in[index] += fuel_flow;
2531 CLAMP(fuel_in[index], 0.0f, 10.0f);
2537 if (color_r && color_r_in) {
2539 float total_dens =
density[index] / (dens_old + dens_flow);
2540 color_r_in[index] = (color_r[index] + ffs->
color[0] * dens_flow) * total_dens;
2541 color_g_in[index] = (color_g[index] + ffs->
color[1] * dens_flow) * total_dens;
2542 color_b_in[index] = (color_b[index] + ffs->
color[2] * dens_flow) * total_dens;
2547 if (fuel && fuel_in) {
2549 float value = 1.0f -
pow2f(1.0f - emission_value);
2551 if (fuel_in[index] > FLT_EPSILON && value > react[index]) {
2552 float f = fuel_flow / fuel_in[index];
2553 react_in[index] = value * f + (1.0f - f) * react[index];
2554 CLAMP(react_in[index], 0.0f, value);
2594 active_fields &= ~prev_flags;
2597 for (flow_index = 0; flow_index < numflowobj; flow_index++) {
2598 Object *flow_ob = flowobjs[flow_index];
2668 static bool escape_flowsobject(
Object *flowobj,
2674 bool is_static = is_static_object(flowobj);
2677 bool gas_flow =
ELEM(
2693 if (liquid_flow && is_geometry && !is_first_frame) {
2697 if ((liquid_flow && gas_domain) || (gas_flow && liquid_domain)) {
2702 if (liquid_flow && is_static && !is_first_frame && !is_resume && !use_velocity) {
2708 static void compute_flowsemission(
Scene *
scene,
2709 FluidObjectBB *bb_maps,
2717 float time_per_frame)
2722 for (
int flow_index = 0; flow_index < numflowobjs; flow_index++) {
2723 Object *flowobj = flowobjs[flow_index];
2736 FluidObjectBB *bb = &bb_maps[flow_index];
2739 if (escape_flowsobject(flowobj, fds, ffs, frame)) {
2745 if (is_first_frame) {
2750 float sample_size = 1.0f / (
float)(subframes + 1);
2751 float subframe_dt = dt * sample_size;
2754 for (
int subframe = 0; subframe <= subframes; subframe++) {
2756 FluidObjectBB bb_temp = {
NULL};
2759 if ((subframe < subframes || time_per_frame + dt + FLT_EPSILON < frame_length) &&
2761 scene->
r.
subframe = (time_per_frame + (subframe + 1.0f) * subframe_dt) / frame_length;
2774 "flow: frame (is first: %d): %d // scene current frame: %d // scene current subframe: "
2791 emit_from_particles(flowobj, fds, ffs, &bb_temp,
depsgraph,
scene, subframe_dt);
2794 emit_from_particles(flowobj, fds, ffs, bb,
depsgraph,
scene, subframe_dt);
2800 emit_from_mesh(flowobj, fds, ffs, &bb_temp, subframe_dt);
2803 emit_from_mesh(flowobj, fds, ffs, bb, subframe_dt);
2807 printf(
"Error: unknown flow emission source\n");
2815 bb_freeData(&bb_temp);
2822 printf(
"flow: frame: %d // time per frame: %f // frame length: %f // dt: %f\n",
2834 float time_per_frame,
2839 FluidObjectBB *bb_maps =
NULL;
2841 uint numflowobjs = 0;
2849 update_flowsflags(fds, flowobjs, numflowobjs);
2850 ensure_flowsfields(fds);
2853 bb_maps =
MEM_callocN(
sizeof(
struct FluidObjectBB) * numflowobjs,
"fluid_flow_bb_maps");
2856 compute_flowsemission(
scene,
2869 adaptive_domain_adjust(fds, ob, bb_maps, numflowobjs, dt);
2905 BLI_assert((color_r && color_g && color_b) || (!color_r && !color_g && !color_b));
2906 BLI_assert((color_r_in && color_g_in && color_b_in) ||
2907 (!color_r_in && !color_g_in && !color_b_in));
2908 BLI_assert((velx_initial && vely_initial && velz_initial) ||
2909 (!velx_initial && !vely_initial && !velz_initial));
2913 for (
z = 0;
z < fds->
res[0] * fds->
res[1] * fds->
res[2];
z++) {
2915 if (phistatic_in && is_first_frame) {
2922 if (phioutstatic_in && is_first_frame) {
2933 heat_in[
z] = heat[
z];
2935 if (color_r_in && color_g_in && color_b_in) {
2936 color_r_in[
z] = color_r[
z];
2937 color_g_in[
z] = color_b[
z];
2938 color_b_in[
z] = color_g[
z];
2941 fuel_in[
z] = fuel[
z];
2942 react_in[
z] = react[
z];
2945 emission_in[
z] = 0.0f;
2947 if (velx_initial && vely_initial && velz_initial) {
2948 velx_initial[
z] = 0.0f;
2949 vely_initial[
z] = 0.0f;
2950 velz_initial[
z] = 0.0f;
2959 for (
int flow_index = 0; flow_index < numflowobjs; flow_index++) {
2960 Object *flowobj = flowobjs[flow_index];
2976 bool is_static = is_static_object(flowobj) &&
2979 FluidObjectBB *bb = &bb_maps[flow_index];
2980 float *velocity_map = bb->velocity;
2981 float *emission_map = bb->influence;
2982 float *distance_map = bb->distances;
2984 int gx, gy, gz, ex, ey, ez, dx, dy, dz;
2985 size_t e_index, d_index;
2988 for (gx = bb->min[0]; gx < bb->
max[0]; gx++) {
2989 for (gy = bb->min[1]; gy < bb->
max[1]; gy++) {
2990 for (gz = bb->min[2]; gz < bb->
max[2]; gz++) {
2992 ex = gx - bb->min[0];
2993 ey = gy - bb->min[1];
2994 ez = gz - bb->min[2];
3003 if (dx < 0 || dy < 0 || dz < 0 || dx >= fds->
res[0] || dy >= fds->
res[1] ||
3004 dz >= fds->
res[2]) {
3010 float *levelset = ((is_first_frame || is_resume) && is_static) ? phioutstatic_in :
3012 apply_outflow_fields(d_index,
3013 distance_map[e_index],
3024 else if (is_geometry && !is_first_frame) {
3025 apply_inflow_fields(ffs,
3047 else if (is_geometry || is_inflow) {
3048 float *levelset = ((is_first_frame || is_resume) && is_static && !is_geometry) ?
3051 apply_inflow_fields(ffs,
3052 emission_map[e_index],
3053 distance_map[e_index],
3074 float vel_initial[3];
3075 vel_initial[0] = velx_initial[d_index];
3076 vel_initial[1] = vely_initial[d_index];
3077 vel_initial[2] = velz_initial[d_index];
3079 float vel_map_strength =
len_squared_v3(velocity_map + 3 * e_index);
3080 if (vel_map_strength > vel_initial_strength) {
3081 velx_initial[d_index] = velocity_map[e_index * 3];
3082 vely_initial[d_index] = velocity_map[e_index * 3 + 1];
3083 velz_initial[d_index] = velocity_map[e_index * 3 + 2];
3100 typedef struct UpdateEffectorsData {
3115 } UpdateEffectorsData;
3117 static void update_effectors_task_cb(
void *__restrict userdata,
3121 UpdateEffectorsData *
data = userdata;
3124 for (
int y = 0;
y < fds->
res[1];
y++) {
3125 for (
int z = 0;
z < fds->
res[2];
z++) {
3128 float voxel_center[3] = {0, 0, 0}, vel[3] = {0, 0, 0}, retvel[3] = {0, 0, 0};
3131 if ((
data->fuel &&
MAX2(
data->density[index],
data->fuel[index]) < FLT_EPSILON) ||
3132 (
data->density &&
data->density[index] < FLT_EPSILON) ||
3133 (
data->phi_obs_in &&
data->phi_obs_in[index] < 0.0f) ||
3134 data->flags[index] & 2)
3140 vel[0] =
data->velocity_x[index];
3141 vel[1] =
data->velocity_y[index];
3142 vel[2] =
data->velocity_z[index];
3169 CLAMP3(retvel, -1.0f, 1.0f);
3170 data->force_x[index] = retvel[0];
3171 data->force_y[index] = retvel[1];
3172 data->force_z[index] = retvel[2];
3176 printf(
"setting force: [%f, %f, %f]\n",
3177 data->force_x[index],
3178 data->force_y[index],
3179 data->force_z[index]);
3185 static void update_effectors(
3195 UpdateEffectorsData
data;
3198 data.effectors = effectors;
3231 float cell_size_scaled[3];
3236 MPoly mp_example = {0};
3237 mpoly = orgmesh->
mpoly;
3239 mp_example = *mpoly;
3242 const short mp_mat_nr = mp_example.
mat_nr;
3243 const char mp_flag = mp_example.
flag;
3246 int num_verts, num_faces;
3257 printf(
"num_verts: %d, num_faces: %d\n", num_verts, num_faces);
3260 if (!num_verts || !num_faces) {
3283 co_scale[0] = max_size / ob->
scale[0];
3284 co_scale[1] = max_size / ob->
scale[1];
3285 co_scale[2] = max_size / ob->
scale[2];
3288 co_offset[0] = (fds->
p0[0] + fds->
p1[0]) / 2.0f;
3289 co_offset[1] = (fds->
p0[1] + fds->
p1[1]) / 2.0f;
3290 co_offset[2] = (fds->
p0[2] + fds->
p1[2]) / 2.0f;
3298 if (use_speedvectors) {
3301 velarray = velocity_layer->
data;
3305 for (i = 0; i < num_verts; i++, mverts++) {
3325 printf(
"mverts->co[0]: %f, mverts->co[1]: %f, mverts->co[2]: %f\n",
3333 printf(
"no_s[0]: %d, no_s[1]: %d, no_s[2]: %d\n", no_s[0], no_s[1], no_s[2]);
3336 if (use_speedvectors) {
3342 printf(
"velarray[%d][0]: %f, velarray[%d][1]: %f, velarray[%d][2]: %f\n",
3354 for (i = 0; i < num_faces; i++, mpolys++, mloops += 3) {
3356 mpolys->mat_nr = mp_mat_nr;
3357 mpolys->flag = mp_flag;
3359 mpolys->loopstart = i * 3;
3360 mpolys->totloop = 3;
3367 printf(
"mloops[0].v: %d, mloops[1].v: %d, mloops[2].v: %d\n",
3393 float ob_loc[3] = {0};
3394 float ob_cache_loc[3] = {0};
3450 ml = &mloops[0 * 4];
3459 ml = &mloops[1 * 4];
3468 ml = &mloops[2 * 4];
3477 ml = &mloops[3 * 4];
3486 ml = &mloops[4 * 4];
3495 ml = &mloops[5 * 4];
3512 for (
int i = 0; i < num_verts; i++) {
3521 static int manta_step(
3525 float dt, frame_length, time_total, time_total_old;
3526 float time_per_frame;
3527 bool init_resolution =
true;
3542 manta_set_domain_from_mesh(fds, ob, me, init_resolution);
3555 while (time_per_frame + FLT_EPSILON < frame_length) {
3564 update_flowsfluids(
depsgraph,
scene, ob, fds, time_per_frame, frame_length, frame, dt);
3567 if (
G.is_break && !mode_replay) {
3575 update_obstacles(
depsgraph,
scene, ob, fds, time_per_frame, frame_length, frame, dt);
3578 if (
G.is_break && !mode_replay) {
3590 time_per_frame += dt;
3609 static void manta_guiding(
3628 const int scene_framenr)
3630 if (scene_framenr >= fmd->
time) {
3641 if (scene_framenr > fmd->
time) {
3642 fmd->
time = scene_framenr;
3644 else if (scene_framenr < fmd->
time) {
3645 fmd->
time = scene_framenr;
3655 const int scene_framenr)
3657 if (scene_framenr >= fmd->
time) {
3668 if (scene_framenr > fmd->
time) {
3669 fmd->
time = scene_framenr;
3671 else if (scene_framenr < fmd->
time) {
3672 fmd->
time = scene_framenr;
3682 const int scene_framenr)
3690 bool is_startframe, has_advanced;
3692 has_advanced = (scene_framenr == fmd->
time + 1);
3696 bool escape =
false;
3701 if (scene_framenr < fds->cache_frame_start ||
3715 if (scene_framenr < fds->cache_frame_start || scene_framenr > fds->
cache_frame_end) {
3721 if (escape && fds->
fluid) {
3749 update_flowsflags(fds, objs, numobj);
3755 update_obstacleflags(fds, objs, numobj);
3762 CLOG_ERROR(&
LOG,
"Fluid initialization failed. Should not happen!");
3771 if (fmd_parent && fmd_parent->
domain) {
3777 int o_res[3], o_min[3], o_max[3], o_shift[3];
3789 update_final_gravity(fds,
scene);
3791 int next_frame = scene_framenr + 1;
3792 int prev_frame = scene_framenr - 1;
3796 int data_frame = scene_framenr, noise_frame = scene_framenr;
3797 int mesh_frame = scene_framenr, particles_frame = scene_framenr, guide_frame = scene_framenr;
3799 bool with_smoke, with_liquid;
3803 bool drops, bubble, floater;
3809 bool with_script, with_noise, with_mesh, with_particles, with_guide;
3814 with_particles = drops || bubble || floater;
3816 bool has_data, has_noise, has_mesh, has_particles, has_guide, has_config;
3828 ensure_flowsfields(fds);
3829 ensure_obstaclefields(fds);
3832 bool baking_data, baking_noise, baking_mesh, baking_particles, baking_guide;
3839 bool resume_data, resume_noise, resume_mesh, resume_particles, resume_guide;
3846 bool read_cache, bake_cache;
3848 bake_cache = baking_data || baking_noise || baking_mesh || baking_particles || baking_guide;
3850 bool next_data, next_noise, next_mesh, next_particles, next_guide;
3857 bool prev_data, prev_noise, prev_mesh, prev_particles, prev_guide;
3875 if (!baking_data && !baking_noise && !baking_mesh && !baking_particles && !baking_guide) {
3889 if (baking_data && resume_data) {
3890 data_frame = prev_frame;
3892 if (baking_noise && resume_noise) {
3893 noise_frame = prev_frame;
3895 if (baking_mesh && resume_mesh) {
3896 mesh_frame = prev_frame;
3898 if (baking_particles && resume_particles) {
3899 particles_frame = prev_frame;
3901 if (baking_guide && resume_guide) {
3902 guide_frame = prev_frame;
3916 baking_data = !has_data && (is_startframe || prev_data);
3917 if (with_smoke && with_noise) {
3918 baking_noise = !has_noise && (is_startframe || prev_noise);
3920 if (with_liquid && with_mesh) {
3921 baking_mesh = !has_mesh && (is_startframe || prev_mesh);
3923 if (with_liquid && with_particles) {
3924 baking_particles = !has_particles && (is_startframe || prev_particles);
3933 bool read_partial =
false, read_all =
false;
3940 if (with_liquid && with_mesh) {
3941 if (mesh_frame != scene_framenr) {
3953 if (with_liquid && with_particles) {
3954 if (particles_frame != scene_framenr) {
3958 read_partial = !baking_data && !baking_particles && next_particles;
3959 read_all = !read_partial && with_resumable_cache;
3970 if (with_smoke && with_noise) {
3971 if (noise_frame != scene_framenr) {
3978 fds, o_res, fds->
res, o_min, fds->
res_min, o_max, o_shift, fds->
shift);
3981 read_partial = !baking_data && !baking_noise && next_noise;
3982 read_all = !read_partial && with_resumable_cache;
3985 read_partial = !baking_data && !baking_noise && next_data && next_noise;
3986 read_all = !read_partial && with_resumable_cache;
3991 if (data_frame != scene_framenr) {
4002 read_partial = !baking_data && !baking_particles && !baking_mesh && next_data &&
4004 read_all = !read_partial && with_resumable_cache;
4013 if (!baking_data && !baking_noise && !baking_mesh && !baking_particles && !baking_guide) {
4020 baking_guide = !has_guide && (is_startframe || prev_guide);
4022 baking_data = !has_data && (is_startframe || prev_data);
4023 if (with_smoke && with_noise) {
4024 baking_noise = !has_noise && (is_startframe || prev_noise);
4026 if (with_liquid && with_mesh) {
4027 baking_mesh = !has_mesh && (is_startframe || prev_mesh);
4029 if (with_liquid && with_particles) {
4030 baking_particles = !has_particles && (is_startframe || prev_particles);
4034 if (is_startframe || has_advanced) {
4035 bake_cache = baking_data || baking_noise || baking_mesh || baking_particles;
4046 if (with_script && is_startframe) {
4055 if (baking_guide && with_guide) {
4065 if (has_data || baking_data) {
4066 if (baking_noise && with_smoke && with_noise) {
4073 if (baking_mesh && with_liquid && with_mesh) {
4076 if (baking_particles && with_liquid && with_particles) {
4086 fmd->
time = scene_framenr;
4089 static void BKE_fluid_modifier_process(
4095 BKE_fluid_modifier_processFlow(fmd,
depsgraph,
scene, ob, me, scene_framenr);
4098 BKE_fluid_modifier_processEffector(fmd,
depsgraph,
scene, ob, me, scene_framenr);
4101 BKE_fluid_modifier_processDomain(fmd,
depsgraph,
scene, ob, me, scene_framenr);
4110 bool needs_viewport_update =
false;
4131 needs_viewport_update =
true;
4137 bool baking_data, baking_noise, baking_mesh, baking_particles, baking_guide;
4144 if (with_mesh && !baking_data && !baking_noise && !baking_mesh && !baking_particles &&
4146 needs_viewport_update =
true;
4154 if (needs_viewport_update) {
4189 static float calc_voxel_transp(
4190 float *
result,
const float *
input,
int res[3],
int *pixel,
float *t_ray,
float correct)
4204 static void bresenham_linie_3D(
int x1,
4217 int dx, dy, dz, i,
l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2;
4228 x_inc = (dx < 0) ? -1 : 1;
4230 y_inc = (dy < 0) ? -1 : 1;
4232 z_inc = (dz < 0) ? -1 : 1;
4238 if ((
l >= m) && (
l >= n)) {
4241 for (i = 0; i <
l; i++) {
4242 if (cb(
result,
input, res, pixel, t_ray, correct) <= FLT_EPSILON) {
4258 else if ((m >=
l) && (m >= n)) {
4261 for (i = 0; i < m; i++) {
4262 if (cb(
result,
input, res, pixel, t_ray, correct) <= FLT_EPSILON) {
4281 for (i = 0; i < n; i++) {
4282 if (cb(
result,
input, res, pixel, t_ray, correct) <= FLT_EPSILON) {
4305 int slabsize = fds->
res[0] * fds->
res[1];
4308 float correct = -7.0f * fds->
dx;
4310 if (!get_light(view_layer, light)) {
4316 light[0] = (light[0] - fds->
p0[0]) / fds->
cell_size[0] - 0.5f - (
float)fds->
res_min[0];
4317 light[1] = (light[1] - fds->
p0[1]) / fds->
cell_size[1] - 0.5f - (
float)fds->
res_min[1];
4318 light[2] = (light[2] - fds->
p0[2]) / fds->
cell_size[2] - 0.5f - (
float)fds->
res_min[2];
4323 bv[3] = (
float)fds->
res[1];
4326 for (
int z = 0;
z < fds->
res[2];
z++) {
4327 size_t index =
z * slabsize;
4329 for (
int y = 0;
y < fds->
res[1];
y++) {
4331 float voxel_center[3];
4337 shadow[
index] = -1.0f;
4339 voxel_center[0] = (
float)
x;
4340 voxel_center[1] = (
float)
y;
4341 voxel_center[2] = (
float)
z;
4352 cell[0] = (int)
floor(light[0]);
4353 cell[1] = (int)
floor(light[1]);
4354 cell[2] = (int)
floor(light[2]);
4357 CLAMP(cell[0], 0, fds->
res[0] - 1);
4358 CLAMP(cell[1], 0, fds->
res[1] - 1);
4359 CLAMP(cell[2], 0, fds->
res[2] - 1);
4361 bresenham_linie_3D(cell[0],
4375 shadow[
index] = t_ray;
4392 float density = 0.0f, fuel = 0.0f;
4395 manta_pos_to_cell(fds,
pos);
4412 if (
pos[0] < 0.0f ||
pos[1] < 0.0f ||
pos[2] < 0.0f) {
4415 if (
pos[0] > 1.0f ||
pos[1] > 1.0f ||
pos[2] > 1.0f) {
4430 vel_mag =
len_v3(velocity);
4466 const char *pset_name,
4467 const char *parts_name,
4468 const char *psys_name,
4469 const int psys_type)
4479 part->
type = psys_type;
4503 next_psys = psys->
next;
4504 if (psys->
part->
type == particle_type) {
4651 const char coba_field = settings->
coba_field;
4655 if (
ELEM(coba_field,
4670 if (
ELEM(coba_field,
4781 else if (fmd->
flow) {
4824 #ifndef WITH_OPENVDB
4829 #ifndef WITH_OPENVDB_BLOSC
4836 char cache_name[64];
5055 else if (tfmd->
flow) {
typedef float(TangentPoint)[2]
Generic geometry attributes built on CustomData.
struct CustomDataLayer * BKE_id_attribute_new(struct ID *id, const char *name, int type, eAttrDomain domain, struct ReportList *reports)
void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
BVHTree * BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data, const struct Mesh *mesh, BVHCacheType bvh_cache_type, int tree_type)
struct Object ** BKE_collision_objects_create(struct Depsgraph *depsgraph, struct Object *self, struct Collection *collection, unsigned int *numcollobj, unsigned int modifier_type)
void BKE_collision_objects_free(struct Object **objects)
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_set_layer(const struct CustomData *data, int type, void *ptr)
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
void * CustomData_get_layer(const struct CustomData *data, int type)
void BKE_effectors_free(struct ListBase *lb)
void BKE_effectors_apply(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *wind_force, float *impulse)
struct EffectorWeights * BKE_effector_add_weights(struct Collection *collection)
void pd_point_from_loc(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
struct ListBase * BKE_effectors_create(struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation)
void BKE_fluid_cache_free_all(struct FluidDomainSettings *fds, struct Object *ob)
int BKE_fluid_get_data_flags(struct FluidDomainSettings *fds)
bool BKE_fluid_reallocate_fluid(struct FluidDomainSettings *fds, int res[3], int free_old)
void BKE_fluid_particle_system_destroy(struct Object *ob, int particle_type)
void BKE_fluid_particle_system_create(struct Main *bmain, struct Object *ob, const char *pset_name, const char *parts_name, const char *psys_name, int psys_type)
struct Mesh * BKE_fluid_modifier_do(struct FluidModifierData *fmd, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct Mesh *me)
float(* BKE_Fluid_BresenhamFn)(float *result, const float *input, int res[3], int *pixel, float *tRay, float correct)
void BKE_fluid_reallocate_copy_fluid(struct FluidDomainSettings *fds, int o_res[3], int n_res[3], const int o_min[3], const int n_min[3], const int o_max[3], int o_shift[3], int n_shift[3])
float BKE_fluid_get_velocity_at(struct Object *ob, float position[3], float velocity[3])
void BKE_fluid_cache_free(struct FluidDomainSettings *fds, struct Object *ob, int cache_map)
@ LIB_ID_COPY_SET_COPIED_ON_WRITE
void BKE_id_free(struct Main *bmain, void *idv)
float(* BKE_mesh_vertex_normals_for_write(struct Mesh *mesh))[3]
struct Mesh * BKE_mesh_copy_for_eval(const struct Mesh *source, bool reference)
void BKE_mesh_copy_parameters_for_eval(struct Mesh *me_dst, const struct Mesh *me_src)
const float(* BKE_mesh_vertex_normals_ensure(const struct Mesh *mesh))[3]
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
void BKE_mesh_texspace_calc(struct Mesh *me)
void BKE_mesh_calc_edges(struct Mesh *mesh, bool keep_existing_edges, bool select_new_edges)
const struct MLoopTri * BKE_mesh_runtime_looptri_ensure(const struct Mesh *mesh)
void BKE_modifier_path_init(char *path, int path_maxlen, const char *name)
void BKE_modifier_free(struct ModifierData *md)
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
const char * BKE_modifier_path_relbase_from_global(struct Object *ob)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
void BKE_modifier_remove_from_list(struct Object *ob, struct ModifierData *md)
struct ModifierData * BKE_modifier_new(int type)
bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md)
General operations, lookup, etc. for blender objects.
bool BKE_object_modifier_update_subframe(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, bool update_mesh, int parent_recursion, float frame, int type)
bool BKE_object_moves_in_time(const struct Object *object, bool recurse_parent)
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
void psys_sim_data_free(struct ParticleSimulationData *sim)
struct ParticleSystemModifierData * psys_get_modifier(struct Object *ob, struct ParticleSystem *psys)
void psys_free(struct Object *ob, struct ParticleSystem *psys)
void psys_sim_data_init(struct ParticleSimulationData *sim)
bool psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, bool always)
struct PointCache * BKE_ptcache_copy_list(struct ListBase *ptcaches_new, const struct ListBase *ptcaches_old, int flag)
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode)
struct PointCache * BKE_ptcache_add(struct ListBase *ptcaches)
void BKE_ptcache_free_list(struct ListBase *ptcaches)
#define PTCACHE_RESET_OUTDATED
void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct FluidModifierData *fmd)
float BKE_scene_ctime_get(const struct Scene *scene)
void BKE_texture_get_value(const struct Scene *scene, struct Tex *texture, const float *tex_co, struct TexResult *texres, bool use_color_management)
#define BLI_assert_unreachable()
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_delete(const char *file, bool dir, bool recursive) ATTR_NONNULL()
BLI_INLINE unsigned int BLI_hash_int(unsigned int k)
float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], const float light_end[3], float pos[3])
int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
A KD-tree for nearest neighbor search.
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float pow2f(float x)
MINLINE int max_ii(int a, int b)
MINLINE int min_iii(int a, int b, int c)
void interp_weights_tri_v3(float w[3], const float v1[3], const float v2[3], const float v3[3], const float co[3])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void add_v3fl_v3fl_v3i(float r[3], const float a[3], const int b[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_fl(float r[3], float f)
MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3], const float a[3], const float b[3], const int c[3])
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v2_v2v2v2(float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
void copy_vn_fl(float *array_tar, int size, float val)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3_int(int r[3])
MINLINE void abs_v3(float r[3])
MINLINE void negate_v3(float r[3])
MINLINE void sub_v3_v3v3_int(int r[3], const int a[3], const int b[3])
MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
size_t BLI_path_join(char *__restrict dst, size_t dst_len, const char *path_first,...) ATTR_NONNULL(1
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
#define THREAD_LOCK_WRITE
#define BLI_MUTEX_INITIALIZER
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
ThreadRWMutex * BLI_rw_mutex_alloc(void)
void BLI_rw_mutex_free(ThreadRWMutex *mutex)
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
pthread_mutex_t ThreadMutex
#define INIT_MINMAX(min, max)
#define CLAMP3(vec, b, c)
float BLI_voxel_sample_trilinear(const float *data, const int res[3], const float co[3])
#define CLOG_ERROR(clg_ref,...)
struct Depsgraph Depsgraph
float DEG_get_ctime(const Depsgraph *graph)
struct ViewLayer * DEG_get_evaluated_view_layer(const struct Depsgraph *graph)
#define DNA_struct_default_alloc(struct_name)
@ FLUID_FLOW_USE_PART_SIZE
@ FLUID_FLOW_NEEDS_UPDATE
@ FLUID_FLOW_USE_PLANE_INIT
@ FLUID_FLOW_INITVELOCITY
@ FLUID_EFFECTOR_GUIDE_MAX
@ FLUID_EFFECTOR_GUIDE_OVERRIDE
@ FLUID_EFFECTOR_GUIDE_AVERAGED
@ FLUID_EFFECTOR_GUIDE_MIN
#define FLUID_DOMAIN_DIR_DATA
#define FLUID_DOMAIN_DIR_PARTICLES
@ FLUID_DOMAIN_TYPE_LIQUID
@ FLUID_FLOW_SOURCE_PARTICLES
#define FLUID_DOMAIN_DIR_DEFAULT
#define FLUID_DOMAIN_DIR_MESH
#define FLUID_DOMAIN_DIR_GUIDE
#define FLUID_DOMAIN_DIR_SCRIPT
@ FLUID_DOMAIN_PARTICLE_SPRAY
@ FLUID_DOMAIN_PARTICLE_FOAM
@ FLUID_DOMAIN_PARTICLE_TRACER
@ FLUID_DOMAIN_PARTICLE_BUBBLE
@ FLUID_DOMAIN_CACHE_REPLAY
@ FLUID_DOMAIN_CACHE_MODULAR
@ FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN
@ FLUID_DOMAIN_USE_RESUMABLE_CACHE
@ FLUID_DOMAIN_EXPORT_MANTA_SCRIPT
@ FLUID_DOMAIN_USE_SPEED_VECTORS
@ FLUID_DOMAIN_ACTIVE_COLORS
@ FLUID_DOMAIN_ACTIVE_FIRE
@ FLUID_DOMAIN_ACTIVE_INVEL
@ FLUID_DOMAIN_ACTIVE_GUIDE
@ FLUID_DOMAIN_ACTIVE_OUTFLOW
@ FLUID_DOMAIN_ACTIVE_COLOR_SET
@ FLUID_DOMAIN_ACTIVE_HEAT
@ FLUID_DOMAIN_ACTIVE_OBSTACLE
@ VDB_PRECISION_MINI_FLOAT
@ VDB_PRECISION_HALF_FLOAT
@ FLUID_DOMAIN_FIELD_COLOR_B
@ FLUID_DOMAIN_FIELD_FLAME
@ FLUID_DOMAIN_FIELD_PHI_OUT
@ FLUID_DOMAIN_FIELD_PHI_OBSTACLE
@ FLUID_DOMAIN_FIELD_DENSITY
@ FLUID_DOMAIN_FIELD_PHI_IN
@ FLUID_DOMAIN_FIELD_HEAT
@ FLUID_DOMAIN_FIELD_COLOR_G
@ FLUID_DOMAIN_FIELD_FUEL
@ FLUID_DOMAIN_FIELD_COLOR_R
#define FLUID_DOMAIN_DIR_CONFIG
@ FLUID_DOMAIN_BAKED_DATA
@ FLUID_DOMAIN_OUTDATED_GUIDE
@ FLUID_DOMAIN_OUTDATED_PARTICLES
@ FLUID_DOMAIN_BAKING_MESH
@ FLUID_DOMAIN_BAKING_NOISE
@ FLUID_DOMAIN_BAKING_GUIDE
@ FLUID_DOMAIN_OUTDATED_NOISE
@ FLUID_DOMAIN_BAKED_NOISE
@ FLUID_DOMAIN_BAKED_MESH
@ FLUID_DOMAIN_OUTDATED_MESH
@ FLUID_DOMAIN_BAKING_DATA
@ FLUID_DOMAIN_BAKED_GUIDE
@ FLUID_DOMAIN_BAKED_PARTICLES
@ FLUID_DOMAIN_OUTDATED_DATA
@ FLUID_DOMAIN_BAKING_PARTICLES
@ FLUID_FLOW_TYPE_SMOKEFIRE
@ FLUID_DOMAIN_BORDER_BOTTOM
@ FLUID_DOMAIN_BORDER_LEFT
@ FLUID_DOMAIN_BORDER_RIGHT
@ FLUID_DOMAIN_BORDER_FRONT
@ FLUID_DOMAIN_BORDER_TOP
@ FLUID_DOMAIN_BORDER_BACK
@ FLUID_DOMAIN_GUIDE_SRC_DOMAIN
@ FLUID_FLOW_TEXTURE_MAP_AUTO
@ FLUID_EFFECTOR_NEEDS_UPDATE
@ FLUID_EFFECTOR_USE_EFFEC
@ FLUID_EFFECTOR_USE_PLANE_INIT
#define FLUID_DOMAIN_DIR_NOISE
@ FLUID_FLOW_BEHAVIOR_GEOMETRY
@ FLUID_FLOW_BEHAVIOR_OUTFLOW
@ FLUID_FLOW_BEHAVIOR_INFLOW
@ FLUID_EFFECTOR_TYPE_GUIDE
@ FLUID_EFFECTOR_TYPE_COLLISION
@ eModifierFlag_SharedCaches
@ eModifierType_ParticleSystem
@ eModifierType_DynamicPaint
Object is a sort of wrapper for general info.
#define PART_DRAW_COL_VEL
Types and defines for representing Rigid Body entities.
#define FIRSTBASE(_view_layer)
#define PHYS_GLOBAL_GRAVITY
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes SyclQueue void const char void *memory_device_pointer KernelContext int size_t global_size
void BKE_fluid_modifier_reset(struct FluidModifierData *fmd)
void BKE_fluid_cachetype_noise_set(FluidDomainSettings *settings, int cache_noise_format)
static void BKE_fluid_modifier_freeDomain(FluidModifierData *fmd)
void BKE_fluid_modifier_copy(const struct FluidModifierData *fmd, struct FluidModifierData *tfmd, const int flag)
void BKE_fluid_cachetype_particle_set(FluidDomainSettings *settings, int cache_particle_format)
void BKE_fluid_flow_behavior_set(Object *UNUSED(object), FluidFlowSettings *settings, int behavior)
void BKE_fluid_domain_type_set(Object *object, FluidDomainSettings *settings, int type)
void BKE_fluid_particles_set(FluidDomainSettings *settings, int value, bool clear)
static void BKE_fluid_modifier_freeFlow(FluidModifierData *fmd)
void BKE_fluid_cachetype_data_set(FluidDomainSettings *settings, int cache_data_format)
static void BKE_fluid_modifier_freeEffector(FluidModifierData *fmd)
static void BKE_fluid_modifier_reset_ex(struct FluidModifierData *fmd, bool need_lock)
void BKE_fluid_modifier_create_type_data(struct FluidModifierData *fmd)
void BKE_fluid_collisionextents_set(FluidDomainSettings *settings, int value, bool clear)
void BKE_fluid_cache_new_name_for_current_session(int maxlen, char *r_name)
void BKE_fluid_cache_endframe_set(FluidDomainSettings *settings, int value)
void BKE_fluid_fields_sanitize(FluidDomainSettings *settings)
void BKE_fluid_cache_startframe_set(FluidDomainSettings *settings, int value)
void BKE_fluid_flow_type_set(Object *object, FluidFlowSettings *settings, int type)
void BKE_fluid_effector_type_set(Object *UNUSED(object), FluidEffectorSettings *settings, int type)
void BKE_fluid_cachetype_mesh_set(FluidDomainSettings *settings, int cache_mesh_format)
void BKE_fluid_modifier_free(FluidModifierData *fmd)
ccl_gpu_kernel_postfix ccl_global int * counter
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
float * manta_smoke_get_heat_in(struct MANTA *smoke)
bool manta_has_particles(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_smoke_get_shadow(struct MANTA *fluid)
float * manta_smoke_get_color_g(struct MANTA *smoke)
float * manta_get_force_y(struct MANTA *fluid)
bool manta_has_mesh(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_phiobs_in(struct MANTA *fluid)
float manta_liquid_get_vertex_y_at(struct MANTA *liquid, int i)
float * manta_smoke_get_color_b(struct MANTA *smoke)
float * manta_smoke_get_emission_in(struct MANTA *smoke)
float * manta_noise_get_texture_w2(struct MANTA *smoke)
bool manta_ensure_invelocity(struct MANTA *fluid, struct FluidModifierData *fmd)
bool manta_read_guiding(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool sourceDomain)
bool manta_has_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
bool manta_bake_particles(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_phioutstatic_in(struct MANTA *fluid)
float * manta_smoke_get_fuel(struct MANTA *smoke)
float * manta_smoke_get_heat(struct MANTA *smoke)
bool manta_smoke_ensure_colors(struct MANTA *smoke, struct FluidModifierData *fmd)
void manta_free(struct MANTA *fluid)
bool manta_smoke_has_heat(struct MANTA *smoke)
int manta_liquid_get_num_triangles(struct MANTA *liquid)
bool manta_bake_mesh(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float manta_get_timestep(struct MANTA *fluid)
float * manta_get_in_velocity_x(struct MANTA *fluid)
bool manta_bake_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_smoke_get_color_g_in(struct MANTA *smoke)
float * manta_smoke_get_color_b_in(struct MANTA *smoke)
float * manta_noise_get_texture_u2(struct MANTA *smoke)
float * manta_smoke_get_color_r_in(struct MANTA *smoke)
float * manta_get_phistatic_in(struct MANTA *fluid)
float * manta_get_guide_velocity_z(struct MANTA *fluid)
float * manta_smoke_get_density(struct MANTA *smoke)
float * manta_smoke_get_color_r(struct MANTA *smoke)
bool manta_read_mesh(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
bool manta_liquid_ensure_sndparts(struct MANTA *fluid, struct FluidModifierData *fmd)
float * manta_get_force_x(struct MANTA *fluid)
float * manta_get_velocity_x(struct MANTA *fluid)
float * manta_smoke_get_flame(struct MANTA *smoke)
float * manta_noise_get_texture_v2(struct MANTA *smoke)
bool manta_write_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
int * manta_smoke_get_flags(struct MANTA *smoke)
float * manta_get_phi_in(struct MANTA *fluid)
bool manta_smoke_ensure_fire(struct MANTA *smoke, struct FluidModifierData *fmd)
float * manta_get_velocity_y(struct MANTA *fluid)
void manta_noise_get_res(struct MANTA *smoke, int *res)
float * manta_noise_get_fuel(struct MANTA *smoke)
float manta_liquid_get_vertvel_y_at(struct MANTA *liquid, int i)
int manta_liquid_get_num_verts(struct MANTA *liquid)
bool manta_ensure_obstacle(struct MANTA *fluid, struct FluidModifierData *fmd)
bool manta_write_config(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_in_velocity_z(struct MANTA *fluid)
float * manta_noise_get_texture_v(struct MANTA *smoke)
bool manta_needs_realloc(struct MANTA *fluid, struct FluidModifierData *fmd)
bool manta_has_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float manta_liquid_get_vertvel_z_at(struct MANTA *liquid, int i)
bool manta_read_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool resumable)
float * manta_get_num_guide(struct MANTA *fluid)
size_t manta_get_index(int x, int max_x, int y, int max_y, int z)
bool manta_read_particles(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool resumable)
bool manta_write_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_force_z(struct MANTA *fluid)
float manta_liquid_get_vertvel_x_at(struct MANTA *liquid, int i)
float * manta_get_ob_velocity_x(struct MANTA *fluid)
float * manta_smoke_get_fuel_in(struct MANTA *smoke)
bool manta_smoke_ensure_heat(struct MANTA *smoke, struct FluidModifierData *fmd)
void manta_update_pointers(struct MANTA *fluid, struct FluidModifierData *fmd, bool flush)
bool manta_ensure_guiding(struct MANTA *fluid, struct FluidModifierData *fmd)
float * manta_noise_get_density(struct MANTA *smoke)
bool manta_read_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool resumable)
float * manta_noise_get_color_b(struct MANTA *smoke)
float * manta_get_ob_velocity_z(struct MANTA *fluid)
float * manta_get_guide_velocity_x(struct MANTA *fluid)
float * manta_get_phiout_in(struct MANTA *fluid)
bool manta_has_guiding(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool domain)
float * manta_noise_get_react(struct MANTA *smoke)
float * manta_noise_get_flame(struct MANTA *smoke)
bool manta_smoke_has_colors(struct MANTA *smoke)
bool manta_read_config(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float manta_liquid_get_vertex_z_at(struct MANTA *liquid, int i)
float * manta_smoke_get_react_in(struct MANTA *smoke)
float * manta_get_in_velocity_y(struct MANTA *fluid)
float * manta_get_velocity_z(struct MANTA *fluid)
float * manta_noise_get_texture_w(struct MANTA *smoke)
int manta_liquid_get_triangle_z_at(struct MANTA *liquid, int i)
bool manta_smoke_has_fuel(struct MANTA *smoke)
float manta_liquid_get_vertex_x_at(struct MANTA *liquid, int i)
float * manta_smoke_get_react(struct MANTA *smoke)
bool manta_liquid_export_script(struct MANTA *smoke, struct FluidModifierData *fmd)
bool manta_ensure_outflow(struct MANTA *fluid, struct FluidModifierData *fmd)
void manta_update_variables(struct MANTA *fluid, struct FluidModifierData *fmd)
int manta_liquid_get_triangle_x_at(struct MANTA *liquid, int i)
float * manta_get_num_obstacle(struct MANTA *fluid)
float * manta_get_phiguide_in(struct MANTA *fluid)
struct MANTA * manta_init(int *res, struct FluidModifierData *fmd)
float * manta_get_guide_velocity_y(struct MANTA *fluid)
float * manta_get_ob_velocity_y(struct MANTA *fluid)
void manta_adapt_timestep(struct MANTA *fluid)
int manta_liquid_get_triangle_y_at(struct MANTA *liquid, int i)
float * manta_noise_get_texture_u(struct MANTA *smoke)
bool manta_bake_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
bool manta_smoke_export_script(struct MANTA *smoke, struct FluidModifierData *fmd)
float * manta_noise_get_color_r(struct MANTA *smoke)
bool manta_bake_guiding(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_phiobsstatic_in(struct MANTA *fluid)
float * manta_noise_get_color_g(struct MANTA *smoke)
float * manta_smoke_get_density_in(struct MANTA *smoke)
ccl_device_inline float3 ceil(const float3 &a)
ccl_device_inline float3 pow(float3 v, float e)
static void clear(Message *msg)
bool is_adaptive(CpuPatchTable *patch_table)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
smooth(Type::FLOAT, "mask_weight")
static void update_velocities(PTCacheEdit *edit)
BVHTree_RayCastCallback raycast_callback
BVHTree_NearestPointCallback nearest_callback
float gridlines_upper_bound
float gridlines_lower_bound
float sndparticle_tau_min_wc
struct ListBase ptcaches[2]
int sndparticle_update_radius
struct FluidModifierData * fmd
char sndparticle_boundary
float fractions_threshold
char cache_particle_format
float particle_randomness
int sndparticle_potential_radius
int cache_frame_pause_mesh
struct Collection * force_group
float mesh_particle_radius
int cache_frame_pause_data
float flame_smoke_color[3]
float sndparticle_tau_max_wc
float sndparticle_tau_max_ta
struct Collection * effector_group
int cache_frame_pause_particles
int cache_frame_pause_guide
float sndparticle_tau_min_ta
char gridlines_cell_filter
struct PointCache * point_cache[2]
char sndparticle_combined_export
float particle_band_width
float sndparticle_tau_min_k
char cache_directory[1024]
float gridlines_range_color[4]
char vector_scale_with_magnitude
char vector_draw_mac_components
int cache_frame_pause_noise
struct Object * guide_parent
float sndparticle_tau_max_k
struct Collection * fluid_group
struct EffectorWeights * effector_weights
char gridlines_color_field
struct FluidModifierData * fmd
struct FluidModifierData * fmd
struct ParticleSystem * psys
struct Tex * noise_texture
struct FluidDomainSettings * domain
struct FluidEffectorSettings * effector
struct FluidFlowSettings * flow
struct ModifierData * next
struct RigidBodyOb * rigidbody_object
struct PointCache * cache
struct Depsgraph * depsgraph
struct ParticleSystem * psys
struct ParticleSystem * psys
struct ParticleSystem * next
struct PointCache * pointcache
struct PhysicsSettings physics_settings