Blender V5.3
draw_fluid.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include <cstring>
12
13#include "BLI_listbase.hh"
14#include "BLI_utildefines.hh"
15
16#include "DNA_fluid_types.h"
17#include "DNA_modifier_types.h"
18
19#include "MEM_guardedalloc.h"
20
21#include "BKE_colorband.hh"
22
24
25#include "GPU_texture.hh"
26
28
29#include "draw_common_c.hh" /* Own include. */
30
31#ifdef WITH_FLUID
32# include "manta_fluid_API.h"
33#endif
34
35namespace blender {
36
37/* -------------------------------------------------------------------- */
40
41#ifdef WITH_FLUID
42
43enum {
44 TFUNC_FLAME_SPECTRUM = 0,
45 TFUNC_COLOR_RAMP = 1,
46};
47
48# define TFUNC_WIDTH 256
49
50static void create_flame_spectrum_texture(float *data)
51{
52# define FIRE_THRESH 7
53# define MAX_FIRE_ALPHA 0.06f
54# define FULL_ON_FIRE 100
55
56 float *spec_pixels = MEM_new_array_uninitialized<float>(TFUNC_WIDTH * 4 * 16 * 16,
57 "spec_pixels");
58
60
61 for (int i = 0; i < 16; i++) {
62 for (int j = 0; j < 16; j++) {
63 for (int k = 0; k < TFUNC_WIDTH; k++) {
64 int index = (j * TFUNC_WIDTH * 16 + i * TFUNC_WIDTH + k) * 4;
65 if (k >= FIRE_THRESH) {
66 spec_pixels[index] = (data[k * 4]);
67 spec_pixels[index + 1] = (data[k * 4 + 1]);
68 spec_pixels[index + 2] = (data[k * 4 + 2]);
69 spec_pixels[index + 3] = MAX_FIRE_ALPHA *
70 ((k > FULL_ON_FIRE) ?
71 1.0f :
72 (k - FIRE_THRESH) / (float(FULL_ON_FIRE) - FIRE_THRESH));
73 }
74 else {
75 zero_v4(&spec_pixels[index]);
76 }
77 }
78 }
79 }
80
81 memcpy(data, spec_pixels, sizeof(float) * 4 * TFUNC_WIDTH);
82
83 MEM_delete(spec_pixels);
84
85# undef FIRE_THRESH
86# undef MAX_FIRE_ALPHA
87# undef FULL_ON_FIRE
88}
89
90static void create_color_ramp(const ColorBand *coba, float *data)
91{
92 for (int i = 0; i < TFUNC_WIDTH; i++) {
93 BKE_colorband_evaluate(coba, float(i) / TFUNC_WIDTH, &data[i * 4]);
95 }
96}
97
98static gpu::Texture *create_transfer_function(int type, const ColorBand *coba)
99{
100 float *data = MEM_new_array_uninitialized<float>(4 * TFUNC_WIDTH, __func__);
101
102 switch (type) {
103 case TFUNC_FLAME_SPECTRUM:
104 create_flame_spectrum_texture(data);
105 break;
106 case TFUNC_COLOR_RAMP:
107 create_color_ramp(coba, data);
108 break;
109 }
110
111 gpu::Texture *tex = GPU_texture_create_1d("transf_func",
112 TFUNC_WIDTH,
113 1,
114 gpu::TextureFormat::SRGBA_8_8_8_8,
116 data);
117
118 MEM_delete(data);
119
120 return tex;
121}
122
123static void swizzle_texture_channel_single(gpu::Texture *tex)
124{
125 /* Swizzle texture channels so that we get useful RGBA values when sampling
126 * a texture with fewer channels, e.g. when using density as color. */
127 GPU_texture_swizzle_set(tex, "rrr1");
128}
129
130static float *rescale_3d(const int dim[3],
131 const int final_dim[3],
132 int channels,
133 const float *fpixels)
134{
135 const uint w = dim[0], h = dim[1], d = dim[2];
136 const uint fw = final_dim[0], fh = final_dim[1], fd = final_dim[2];
137 const uint xf = w / fw, yf = h / fh, zf = d / fd;
138 const uint pixel_count = fw * fh * fd;
139 float *nfpixels = MEM_new_array_uninitialized<float>(channels * pixel_count, __func__);
140
141 if (nfpixels) {
142 printf("Performance: You need to scale a 3D texture, feel the pain!\n");
143
144 for (uint k = 0; k < fd; k++) {
145 for (uint j = 0; j < fh; j++) {
146 for (uint i = 0; i < fw; i++) {
147 /* Obviously doing nearest filtering here,
148 * it's going to be slow in any case, let's not make it worse. */
149 float xb = i * xf;
150 float yb = j * yf;
151 float zb = k * zf;
152 uint offset = k * (fw * fh) + i * fh + j;
153 uint offset_orig = (zb) * (w * h) + (xb)*h + (yb);
154
155 if (channels == 4) {
156 nfpixels[offset * 4] = fpixels[offset_orig * 4];
157 nfpixels[offset * 4 + 1] = fpixels[offset_orig * 4 + 1];
158 nfpixels[offset * 4 + 2] = fpixels[offset_orig * 4 + 2];
159 nfpixels[offset * 4 + 3] = fpixels[offset_orig * 4 + 3];
160 }
161 else if (channels == 1) {
162 nfpixels[offset] = fpixels[offset_orig];
163 }
164 else {
165 BLI_assert(0);
166 }
167 }
168 }
169 }
170 }
171 return nfpixels;
172}
173
174/* Will resize input to fit GL system limits. */
175static gpu::Texture *create_volume_texture(const int dim[3],
176 gpu::TextureFormat texture_format,
177 eGPUDataFormat data_format,
178 const void *data)
179{
180 gpu::Texture *tex = nullptr;
181 int3 final_dim = {UNPACK3(dim)};
182
183 if (data == nullptr) {
184 return nullptr;
185 }
186
187 while (true) {
189 "volume", UNPACK3(final_dim), 1, texture_format, GPU_TEXTURE_USAGE_SHADER_READ, nullptr);
190
191 if (tex != nullptr) {
192 break;
193 }
194
195 if (final_dim[0] == 1 && final_dim[1] == 1 && final_dim[2] == 1) {
196 break;
197 }
198
199 for (int i = 0; i < 3; i++) {
200 final_dim[i] = max_ii(1, final_dim[i] / 2);
201 }
202 }
203
204 if (tex == nullptr) {
205 printf("Error: Could not create 3D texture.\n");
206 tex = GPU_texture_create_error(3, false);
207 }
208 else if (int3(dim) == final_dim) {
209 /* No need to resize, just upload the data. */
210 GPU_texture_update_sub(tex, data_format, data, 0, 0, 0, UNPACK3(final_dim));
211 }
212 else if (data_format != GPU_DATA_FLOAT) {
213 printf("Error: Could not allocate 3D texture and not attempting to rescale non-float data.\n");
214 tex = GPU_texture_create_error(3, false);
215 }
216 else {
217 /* We need to resize the input. */
218 int channels = ELEM(texture_format,
219 gpu::TextureFormat::UNORM_8,
220 gpu::TextureFormat::SFLOAT_16,
221 gpu::TextureFormat::SFLOAT_32) ?
222 1 :
223 4;
224 float *rescaled_data = rescale_3d(dim, final_dim, channels, static_cast<const float *>(data));
225 if (rescaled_data) {
226 GPU_texture_update_sub(tex, GPU_DATA_FLOAT, rescaled_data, 0, 0, 0, UNPACK3(final_dim));
227 MEM_delete(rescaled_data);
228 }
229 else {
230 printf("Error: Could not allocate rescaled 3d texture!\n");
231 GPU_texture_free(tex);
232 tex = GPU_texture_create_error(3, false);
233 }
234 }
235 return tex;
236}
237
238static gpu::Texture *create_field_texture(FluidDomainSettings *fds, bool single_precision)
239{
240 void *field = nullptr;
241 eGPUDataFormat data_format = GPU_DATA_FLOAT;
242 gpu::TextureFormat texture_format = gpu::TextureFormat::UNORM_8;
243
244 if (single_precision) {
245 texture_format = gpu::TextureFormat::SFLOAT_32;
246 }
247
248 switch (fds->coba_field) {
250 field = manta_smoke_get_density(fds->fluid);
251 break;
253 field = manta_smoke_get_heat(fds->fluid);
254 break;
256 field = manta_smoke_get_fuel(fds->fluid);
257 break;
259 field = manta_smoke_get_react(fds->fluid);
260 break;
262 field = manta_smoke_get_flame(fds->fluid);
263 break;
265 field = manta_get_velocity_x(fds->fluid);
266 break;
268 field = manta_get_velocity_y(fds->fluid);
269 break;
271 field = manta_get_velocity_z(fds->fluid);
272 break;
274 field = manta_smoke_get_color_r(fds->fluid);
275 break;
277 field = manta_smoke_get_color_g(fds->fluid);
278 break;
280 field = manta_smoke_get_color_b(fds->fluid);
281 break;
283 field = manta_get_force_x(fds->fluid);
284 break;
286 field = manta_get_force_y(fds->fluid);
287 break;
289 field = manta_get_force_z(fds->fluid);
290 break;
292 field = manta_get_phi(fds->fluid);
293 texture_format = gpu::TextureFormat::SFLOAT_16;
294 break;
296 field = manta_get_phi_in(fds->fluid);
297 texture_format = gpu::TextureFormat::SFLOAT_16;
298 break;
300 field = manta_get_phiout_in(fds->fluid);
301 texture_format = gpu::TextureFormat::SFLOAT_16;
302 break;
304 field = manta_get_phiobs_in(fds->fluid);
305 texture_format = gpu::TextureFormat::SFLOAT_16;
306 break;
308 field = manta_smoke_get_flags(fds->fluid);
309 data_format = GPU_DATA_INT;
310 texture_format = gpu::TextureFormat::UINT_8;
311 break;
313 field = manta_get_pressure(fds->fluid);
314 texture_format = gpu::TextureFormat::SFLOAT_16;
315 break;
316 default:
317 return nullptr;
318 }
319
320 if (field == nullptr) {
321 return nullptr;
322 }
323
324 gpu::Texture *tex = create_volume_texture(fds->res, texture_format, data_format, field);
325 swizzle_texture_channel_single(tex);
326 return tex;
327}
328
329static gpu::Texture *create_density_texture(FluidDomainSettings *fds, int highres)
330{
331 int *dim = (highres) ? fds->res_noise : fds->res;
332
333 float *data;
334 if (highres) {
335 data = manta_noise_get_density(fds->fluid);
336 }
337 else {
338 data = manta_smoke_get_density(fds->fluid);
339 }
340
341 if (data == nullptr) {
342 return nullptr;
343 }
344
345 gpu::Texture *tex = create_volume_texture(
346 dim, gpu::TextureFormat::UNORM_8, GPU_DATA_FLOAT, data);
347 swizzle_texture_channel_single(tex);
348 return tex;
349}
350
351static gpu::Texture *create_color_texture(FluidDomainSettings *fds, int highres)
352{
353 const bool has_color = (highres) ? manta_noise_has_colors(fds->fluid) :
354 manta_smoke_has_colors(fds->fluid);
355
356 if (!has_color) {
357 return nullptr;
358 }
359
360 int cell_count = (highres) ? manta_noise_get_cells(fds->fluid) : fds->total_cells;
361 int *dim = (highres) ? fds->res_noise : fds->res;
362 float *data = MEM_new_array_zeroed<float>(cell_count * 4, "smokeColorTexture");
363
364 if (data == nullptr) {
365 return nullptr;
366 }
367
368 if (highres) {
369 manta_noise_get_rgba(fds->fluid, data, 0);
370 }
371 else {
372 manta_smoke_get_rgba(fds->fluid, data, 0);
373 }
374
375 gpu::Texture *tex = create_volume_texture(
376 dim, gpu::TextureFormat::UNORM_8_8_8_8, GPU_DATA_FLOAT, data);
377
378 MEM_delete(data);
379
380 return tex;
381}
382
383static gpu::Texture *create_flame_texture(FluidDomainSettings *fds, int highres)
384{
385 float *source = nullptr;
386 const bool has_fuel = (highres) ? manta_noise_has_fuel(fds->fluid) :
387 manta_smoke_has_fuel(fds->fluid);
388 int *dim = (highres) ? fds->res_noise : fds->res;
389
390 if (!has_fuel) {
391 return nullptr;
392 }
393
394 if (highres) {
395 source = manta_noise_get_flame(fds->fluid);
396 }
397 else {
398 source = manta_smoke_get_flame(fds->fluid);
399 }
400
401 gpu::Texture *tex = create_volume_texture(
402 dim, gpu::TextureFormat::UNORM_8, GPU_DATA_FLOAT, source);
403 swizzle_texture_channel_single(tex);
404 return tex;
405}
406
407static bool get_smoke_velocity_field(FluidDomainSettings *fds,
408 float **r_velocity_x,
409 float **r_velocity_y,
410 float **r_velocity_z)
411{
412 const char vector_field = fds->vector_field;
413 switch ((FLUID_DisplayVectorField)vector_field) {
415 *r_velocity_x = manta_get_velocity_x(fds->fluid);
416 *r_velocity_y = manta_get_velocity_y(fds->fluid);
417 *r_velocity_z = manta_get_velocity_z(fds->fluid);
418 break;
420 *r_velocity_x = manta_get_guide_velocity_x(fds->fluid);
421 *r_velocity_y = manta_get_guide_velocity_y(fds->fluid);
422 *r_velocity_z = manta_get_guide_velocity_z(fds->fluid);
423 break;
425 *r_velocity_x = manta_get_force_x(fds->fluid);
426 *r_velocity_y = manta_get_force_y(fds->fluid);
427 *r_velocity_z = manta_get_force_z(fds->fluid);
428 break;
429 }
430
431 return *r_velocity_x && *r_velocity_y && *r_velocity_z;
432}
433
434#endif /* WITH_FLUID */
435
437
438/* -------------------------------------------------------------------- */
441
443{
444#ifndef WITH_FLUID
445 UNUSED_VARS(fmd);
446#else
447 if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
448 FluidDomainSettings *fds = fmd->domain;
449
450 if (!fds->tex_field) {
451 fds->tex_field = create_field_texture(fds, false);
452 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_field));
453 }
454 if (!fds->tex_coba && !ELEM(fds->coba_field,
461 {
462 fds->tex_coba = create_transfer_function(TFUNC_COLOR_RAMP, fds->coba);
463 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_coba));
464 }
465 }
466#endif
467}
468
469void DRW_smoke_ensure(FluidModifierData *fmd, int highres)
470{
471#ifndef WITH_FLUID
472 UNUSED_VARS(fmd, highres);
473#else
474 if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
475 FluidDomainSettings *fds = fmd->domain;
476
477 if (!fds->tex_density) {
478 fds->tex_density = create_density_texture(fds, highres);
479 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_density));
480 }
481 if (!fds->tex_color) {
482 fds->tex_color = create_color_texture(fds, highres);
483 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_color));
484 }
485 if (!fds->tex_flame) {
486 fds->tex_flame = create_flame_texture(fds, highres);
487 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_flame));
488 }
489 if (!fds->tex_flame_coba && fds->tex_flame) {
490 fds->tex_flame_coba = create_transfer_function(TFUNC_FLAME_SPECTRUM, nullptr);
491 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_flame_coba));
492 }
493 if (!fds->tex_shadow) {
494 fds->tex_shadow = create_volume_texture(fds->res,
495 gpu::TextureFormat::UNORM_8,
498 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_shadow));
499 }
500 }
501#endif /* WITH_FLUID */
502}
503
505{
506#ifndef WITH_FLUID
507 UNUSED_VARS(fmd);
508#else
509 if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
510 FluidDomainSettings *fds = fmd->domain;
511 float *vel_x = nullptr, *vel_y = nullptr, *vel_z = nullptr;
512
513 if (!get_smoke_velocity_field(fds, &vel_x, &vel_y, &vel_z)) {
515 get_smoke_velocity_field(fds, &vel_x, &vel_y, &vel_z);
516 }
517
518 if (ELEM(nullptr, vel_x, vel_y, vel_z)) {
519 return;
520 }
521
522 if (!fds->tex_velocity_x) {
524 UNPACK3(fds->res),
525 1,
526 gpu::TextureFormat::SFLOAT_16,
528 vel_x);
530 UNPACK3(fds->res),
531 1,
532 gpu::TextureFormat::SFLOAT_16,
534 vel_y);
536 UNPACK3(fds->res),
537 1,
538 gpu::TextureFormat::SFLOAT_16,
540 vel_z);
541 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_velocity_x));
542 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_velocity_y));
543 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_velocity_z));
544 }
545 }
546#endif /* WITH_FLUID */
547}
548
550{
551#ifndef WITH_FLUID
552 UNUSED_VARS(fmd);
553#else
554 if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
555 FluidDomainSettings *fds = fmd->domain;
556 if (!fds->tex_flags) {
557 fds->tex_flags = create_volume_texture(
558 fds->res, gpu::TextureFormat::UINT_8, GPU_DATA_INT, manta_smoke_get_flags(fds->fluid));
559 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_flags));
560
561 swizzle_texture_channel_single(fds->tex_flags);
562 }
563 }
564#endif /* WITH_FLUID */
565}
566
568{
569#ifndef WITH_FLUID
570 UNUSED_VARS(fmd);
571#else
572 if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
573 FluidDomainSettings *fds = fmd->domain;
574
575 if (!fds->tex_range_field) {
576 fds->tex_range_field = create_field_texture(fds, true);
577 BLI_addtail(&drw_get().data->smoke_textures, BLI_genericNodeN(&fds->tex_range_field));
578 }
579 }
580#endif /* WITH_FLUID */
581}
582
584{
585 if (drw_data->smoke_textures.is_empty()) {
586 return;
587 }
588 /* See workaround at blender::eevee::Instance::render_sample
589 * Calling exit here as sync can happen multiple times when shaders are still being compiled
590 * during image rendering. */
591 DRW_smoke_exit(drw_data);
592}
593
594void DRW_smoke_exit(DRWData *drw_data)
595{
596 /* Free Smoke Textures after rendering */
597 /* XXX This is a waste of processing and GPU bandwidth if nothing
598 * is updated. But the problem is since Textures are stored in the
599 * modifier we don't want them to take precious VRAM if the
600 * modifier is not used for display. We should share them for
601 * all viewport in a redraw at least. */
602 for (LinkData &link : drw_data->smoke_textures) {
604 }
605 drw_data->smoke_textures.free_no_destruct();
606}
607
609
610} // namespace blender
#define GPU_TEXTURE_FREE_SAFE(texture)
Read Blender memory allocation and freeing.
#define UNUSED_VARS(...)
#define UNPACK3(a)
#define ELEM(...)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
BMesh Iterators.
@ FLUID_DOMAIN_FIELD_COLOR_G
@ FLUID_DOMAIN_FIELD_FLAGS
@ FLUID_DOMAIN_FIELD_FUEL
@ FLUID_DOMAIN_FIELD_FORCE_Y
@ FLUID_DOMAIN_FIELD_PHI_OBSTACLE
@ FLUID_DOMAIN_FIELD_REACT
@ FLUID_DOMAIN_FIELD_PHI_IN
@ FLUID_DOMAIN_FIELD_FLAME
@ FLUID_DOMAIN_FIELD_COLOR_B
@ FLUID_DOMAIN_FIELD_PRESSURE
@ FLUID_DOMAIN_FIELD_VELOCITY_Z
@ FLUID_DOMAIN_FIELD_FORCE_X
@ FLUID_DOMAIN_FIELD_FORCE_Z
@ FLUID_DOMAIN_FIELD_DENSITY
@ FLUID_DOMAIN_FIELD_VELOCITY_Y
@ FLUID_DOMAIN_FIELD_COLOR_R
@ FLUID_DOMAIN_FIELD_VELOCITY_X
@ FLUID_DOMAIN_FIELD_PHI_OUT
@ FLUID_DOMAIN_FIELD_PHI
@ FLUID_DOMAIN_FIELD_HEAT
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void DRW_fluid_ensure_flags(FluidModifierData *fmd)
gpu::Texture * GPU_texture_create_1d(const char *name, int width, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
float * manta_get_guide_velocity_x(struct MANTA *fluid)
unsigned int uint
Definition BKE_text.h:55
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
float * manta_smoke_get_react(struct MANTA *smoke)
float * manta_smoke_get_shadow(struct MANTA *smoke)
void DRW_smoke_ensure_coba_field(FluidModifierData *fmd)
float * manta_get_force_x(struct MANTA *fluid)
void manta_smoke_get_rgba(struct MANTA *smoke, float *data, int sequential)
float * manta_get_phiout_in(struct MANTA *fluid)
float * manta_get_phi_in(struct MANTA *fluid)
float * manta_smoke_get_heat(struct MANTA *smoke)
DRWContext & drw_get()
MINLINE int max_ii(int a, int b)
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
Definition colorband.cc:399
@ FLUID_DOMAIN_VECTOR_FIELD_VELOCITY
@ FLUID_DOMAIN_VECTOR_FIELD_FORCE
@ FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY
float * manta_noise_get_density(struct MANTA *smoke)
float * manta_get_pressure(struct MANTA *fluid)
float * manta_get_guide_velocity_y(struct MANTA *fluid)
bool manta_smoke_has_colors(struct MANTA *smoke)
MINLINE void zero_v4(float r[4])
void GPU_texture_update_sub(gpu::Texture *texture, eGPUDataFormat data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth, uint unpack_row_length=0)
float * manta_get_velocity_z(struct MANTA *fluid)
VecBase< int32_t, 3 > int3
float * manta_get_force_z(struct MANTA *fluid)
@ GPU_TEXTURE_USAGE_SHADER_READ
BMesh const char void * data
float * manta_smoke_get_color_r(struct MANTA *smoke)
void GPU_texture_swizzle_set(gpu::Texture *texture, const char swizzle[4])
void DRW_smoke_ensure_velocity(FluidModifierData *fmd)
gpu::Texture * GPU_texture_create_3d(const char *name, int width, int height, int depth, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const void *data)
LinkData * BLI_genericNodeN(void *data)
Definition listbase.cc:936
float * manta_get_force_y(struct MANTA *fluid)
void DRW_smoke_ensure(FluidModifierData *fmd, int highres)
bool manta_smoke_has_fuel(struct MANTA *smoke)
float * manta_smoke_get_fuel(struct MANTA *smoke)
float * manta_smoke_get_density(struct MANTA *smoke)
int * manta_smoke_get_flags(struct MANTA *smoke)
float * manta_get_guide_velocity_z(struct MANTA *fluid)
float * manta_noise_get_flame(struct MANTA *smoke)
void DRW_smoke_exit(DRWData *drw_data)
float * manta_get_phi(struct MANTA *fluid)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
void IMB_colormanagement_blackbody_temperature_to_rgb_table(float *r_table, int width, float min, float max)
void GPU_texture_free(gpu::Texture *texture)
float * manta_smoke_get_flame(struct MANTA *smoke)
float * manta_get_phiobs_in(struct MANTA *fluid)
void manta_noise_get_rgba(struct MANTA *smoke, float *data, int sequential)
float * manta_get_velocity_x(struct MANTA *fluid)
gpu::Texture * GPU_texture_create_error(int dimension, bool array)
bool manta_noise_has_fuel(struct MANTA *smoke)
float * manta_get_velocity_y(struct MANTA *fluid)
float * manta_smoke_get_color_b(struct MANTA *smoke)
void DRW_fluid_ensure_range_field(FluidModifierData *fmd)
MINLINE void straight_to_premul_v4(float color[4])
float * manta_smoke_get_color_g(struct MANTA *smoke)
void DRW_smoke_begin_sync(DRWData *drw_data)
int manta_noise_get_cells(struct MANTA *smoke)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
bool manta_noise_has_colors(struct MANTA *smoke)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ListBaseT< LinkData > smoke_textures
eFluidDomain_CobaField coba_field
FLUID_DisplayVectorField vector_field
struct FluidDomainSettings * domain