Blender  V3.3
draw_fluid.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
10 #include <string.h>
11 
12 #include "BLI_listbase.h"
13 #include "BLI_math.h"
14 #include "BLI_utildefines.h"
15 
16 #include "DNA_fluid_types.h"
17 #include "DNA_modifier_types.h"
18 
19 #include "MEM_guardedalloc.h"
20 
21 #include "BKE_colorband.h"
22 
23 #include "IMB_colormanagement.h"
24 
25 #include "GPU_texture.h"
26 
27 #include "draw_manager.h"
28 
29 #include "draw_common.h" /* Own include. */
30 
31 #ifdef WITH_FLUID
32 # include "manta_fluid_API.h"
33 #endif
34 
35 /* -------------------------------------------------------------------- */
39 #ifdef WITH_FLUID
40 
41 enum {
42  TFUNC_FLAME_SPECTRUM = 0,
43  TFUNC_COLOR_RAMP = 1,
44 };
45 
46 # define TFUNC_WIDTH 256
47 
48 static void create_flame_spectrum_texture(float *data)
49 {
50 # define FIRE_THRESH 7
51 # define MAX_FIRE_ALPHA 0.06f
52 # define FULL_ON_FIRE 100
53 
54  float *spec_pixels = (float *)MEM_mallocN(TFUNC_WIDTH * 4 * 16 * 16 * sizeof(float),
55  "spec_pixels");
56 
58 
59  for (int i = 0; i < 16; i++) {
60  for (int j = 0; j < 16; j++) {
61  for (int k = 0; k < TFUNC_WIDTH; k++) {
62  int index = (j * TFUNC_WIDTH * 16 + i * TFUNC_WIDTH + k) * 4;
63  if (k >= FIRE_THRESH) {
64  spec_pixels[index] = (data[k * 4]);
65  spec_pixels[index + 1] = (data[k * 4 + 1]);
66  spec_pixels[index + 2] = (data[k * 4 + 2]);
67  spec_pixels[index + 3] = MAX_FIRE_ALPHA *
68  ((k > FULL_ON_FIRE) ?
69  1.0f :
70  (k - FIRE_THRESH) / ((float)FULL_ON_FIRE - FIRE_THRESH));
71  }
72  else {
73  zero_v4(&spec_pixels[index]);
74  }
75  }
76  }
77  }
78 
79  memcpy(data, spec_pixels, sizeof(float) * 4 * TFUNC_WIDTH);
80 
81  MEM_freeN(spec_pixels);
82 
83 # undef FIRE_THRESH
84 # undef MAX_FIRE_ALPHA
85 # undef FULL_ON_FIRE
86 }
87 
88 static void create_color_ramp(const struct ColorBand *coba, float *data)
89 {
90  for (int i = 0; i < TFUNC_WIDTH; i++) {
91  BKE_colorband_evaluate(coba, (float)i / TFUNC_WIDTH, &data[i * 4]);
92  straight_to_premul_v4(&data[i * 4]);
93  }
94 }
95 
96 static GPUTexture *create_transfer_function(int type, const struct ColorBand *coba)
97 {
98  float *data = (float *)MEM_mallocN(sizeof(float[4]) * TFUNC_WIDTH, __func__);
99 
100  switch (type) {
101  case TFUNC_FLAME_SPECTRUM:
102  create_flame_spectrum_texture(data);
103  break;
104  case TFUNC_COLOR_RAMP:
105  create_color_ramp(coba, data);
106  break;
107  }
108 
109  GPUTexture *tex = GPU_texture_create_1d("transf_func", TFUNC_WIDTH, 1, GPU_SRGB8_A8, data);
110 
111  MEM_freeN(data);
112 
113  return tex;
114 }
115 
116 static void swizzle_texture_channel_single(GPUTexture *tex)
117 {
118  /* Swizzle texture channels so that we get useful RGBA values when sampling
119  * a texture with fewer channels, e.g. when using density as color. */
120  GPU_texture_swizzle_set(tex, "rrr1");
121 }
122 
123 static float *rescale_3d(const int dim[3],
124  const int final_dim[3],
125  int channels,
126  const float *fpixels)
127 {
128  const uint w = dim[0], h = dim[1], d = dim[2];
129  const uint fw = final_dim[0], fh = final_dim[1], fd = final_dim[2];
130  const uint xf = w / fw, yf = h / fh, zf = d / fd;
131  const uint pixel_count = fw * fh * fd;
132  float *nfpixels = (float *)MEM_mallocN(channels * sizeof(float) * pixel_count, __func__);
133 
134  if (nfpixels) {
135  printf("Performance: You need to scale a 3D texture, feel the pain!\n");
136 
137  for (uint k = 0; k < fd; k++) {
138  for (uint j = 0; j < fh; j++) {
139  for (uint i = 0; i < fw; i++) {
140  /* Obviously doing nearest filtering here,
141  * it's going to be slow in any case, let's not make it worse. */
142  float xb = i * xf;
143  float yb = j * yf;
144  float zb = k * zf;
145  uint offset = k * (fw * fh) + i * fh + j;
146  uint offset_orig = (zb) * (w * h) + (xb)*h + (yb);
147 
148  if (channels == 4) {
149  nfpixels[offset * 4] = fpixels[offset_orig * 4];
150  nfpixels[offset * 4 + 1] = fpixels[offset_orig * 4 + 1];
151  nfpixels[offset * 4 + 2] = fpixels[offset_orig * 4 + 2];
152  nfpixels[offset * 4 + 3] = fpixels[offset_orig * 4 + 3];
153  }
154  else if (channels == 1) {
155  nfpixels[offset] = fpixels[offset_orig];
156  }
157  else {
158  BLI_assert(0);
159  }
160  }
161  }
162  }
163  }
164  return nfpixels;
165 }
166 
167 /* Will resize input to fit GL system limits. */
168 static GPUTexture *create_volume_texture(const int dim[3],
169  eGPUTextureFormat texture_format,
170  eGPUDataFormat data_format,
171  const void *data)
172 {
173  GPUTexture *tex = NULL;
174  int final_dim[3] = {UNPACK3(dim)};
175 
176  if (data == NULL) {
177  return NULL;
178  }
179 
180  while (1) {
182  "volume", UNPACK3(final_dim), 1, texture_format, data_format, NULL);
183 
184  if (tex != NULL) {
185  break;
186  }
187 
188  if (final_dim[0] == 1 && final_dim[1] == 1 && final_dim[2] == 1) {
189  break;
190  }
191 
192  for (int i = 0; i < 3; i++) {
193  final_dim[i] = max_ii(1, final_dim[i] / 2);
194  }
195  }
196 
197  if (tex == NULL) {
198  printf("Error: Could not create 3D texture.\n");
199  tex = GPU_texture_create_error(3, false);
200  }
201  else if (equals_v3v3_int(dim, final_dim)) {
202  /* No need to resize, just upload the data. */
203  GPU_texture_update_sub(tex, data_format, data, 0, 0, 0, UNPACK3(final_dim));
204  }
205  else if (data_format != GPU_DATA_FLOAT) {
206  printf("Error: Could not allocate 3D texture and not attempting to rescale non-float data.\n");
207  tex = GPU_texture_create_error(3, false);
208  }
209  else {
210  /* We need to resize the input. */
211  int channels = (ELEM(texture_format, GPU_R8, GPU_R16F, GPU_R32F)) ? 1 : 4;
212  float *rescaled_data = rescale_3d(dim, final_dim, channels, data);
213  if (rescaled_data) {
214  GPU_texture_update_sub(tex, GPU_DATA_FLOAT, rescaled_data, 0, 0, 0, UNPACK3(final_dim));
215  MEM_freeN(rescaled_data);
216  }
217  else {
218  printf("Error: Could not allocate rescaled 3d texture!\n");
220  tex = GPU_texture_create_error(3, false);
221  }
222  }
223  return tex;
224 }
225 
226 static GPUTexture *create_field_texture(FluidDomainSettings *fds, bool single_precision)
227 {
228  void *field = NULL;
229  eGPUDataFormat data_format = GPU_DATA_FLOAT;
230  eGPUTextureFormat texture_format = GPU_R8;
231 
232  if (single_precision) {
233  texture_format = GPU_R32F;
234  }
235 
236  switch (fds->coba_field) {
238  field = manta_smoke_get_density(fds->fluid);
239  break;
241  field = manta_smoke_get_heat(fds->fluid);
242  break;
244  field = manta_smoke_get_fuel(fds->fluid);
245  break;
247  field = manta_smoke_get_react(fds->fluid);
248  break;
250  field = manta_smoke_get_flame(fds->fluid);
251  break;
253  field = manta_get_velocity_x(fds->fluid);
254  break;
256  field = manta_get_velocity_y(fds->fluid);
257  break;
259  field = manta_get_velocity_z(fds->fluid);
260  break;
262  field = manta_smoke_get_color_r(fds->fluid);
263  break;
265  field = manta_smoke_get_color_g(fds->fluid);
266  break;
268  field = manta_smoke_get_color_b(fds->fluid);
269  break;
271  field = manta_get_force_x(fds->fluid);
272  break;
274  field = manta_get_force_y(fds->fluid);
275  break;
277  field = manta_get_force_z(fds->fluid);
278  break;
280  field = manta_get_phi(fds->fluid);
281  texture_format = GPU_R16F;
282  break;
284  field = manta_get_phi_in(fds->fluid);
285  texture_format = GPU_R16F;
286  break;
288  field = manta_get_phiout_in(fds->fluid);
289  texture_format = GPU_R16F;
290  break;
292  field = manta_get_phiobs_in(fds->fluid);
293  texture_format = GPU_R16F;
294  break;
296  field = manta_smoke_get_flags(fds->fluid);
297  data_format = GPU_DATA_INT;
298  texture_format = GPU_R8UI;
299  break;
301  field = manta_get_pressure(fds->fluid);
302  texture_format = GPU_R16F;
303  break;
304  default:
305  return NULL;
306  }
307 
308  if (field == NULL) {
309  return NULL;
310  }
311 
312  GPUTexture *tex = create_volume_texture(fds->res, texture_format, data_format, field);
313  swizzle_texture_channel_single(tex);
314  return tex;
315 }
316 
317 static GPUTexture *create_density_texture(FluidDomainSettings *fds, int highres)
318 {
319  int *dim = (highres) ? fds->res_noise : fds->res;
320 
321  float *data;
322  if (highres) {
324  }
325  else {
327  }
328 
329  if (data == NULL) {
330  return NULL;
331  }
332 
333  GPUTexture *tex = create_volume_texture(dim, GPU_R8, GPU_DATA_FLOAT, data);
334  swizzle_texture_channel_single(tex);
335  return tex;
336 }
337 
338 static GPUTexture *create_color_texture(FluidDomainSettings *fds, int highres)
339 {
340  const bool has_color = (highres) ? manta_noise_has_colors(fds->fluid) :
342 
343  if (!has_color) {
344  return NULL;
345  }
346 
347  int cell_count = (highres) ? manta_noise_get_cells(fds->fluid) : fds->total_cells;
348  int *dim = (highres) ? fds->res_noise : fds->res;
349  float *data = (float *)MEM_callocN(sizeof(float) * cell_count * 4, "smokeColorTexture");
350 
351  if (data == NULL) {
352  return NULL;
353  }
354 
355  if (highres) {
356  manta_noise_get_rgba(fds->fluid, data, 0);
357  }
358  else {
359  manta_smoke_get_rgba(fds->fluid, data, 0);
360  }
361 
362  GPUTexture *tex = create_volume_texture(dim, GPU_RGBA8, GPU_DATA_FLOAT, data);
363 
364  MEM_freeN(data);
365 
366  return tex;
367 }
368 
369 static GPUTexture *create_flame_texture(FluidDomainSettings *fds, int highres)
370 {
371  float *source = NULL;
372  const bool has_fuel = (highres) ? manta_noise_has_fuel(fds->fluid) :
374  int *dim = (highres) ? fds->res_noise : fds->res;
375 
376  if (!has_fuel) {
377  return NULL;
378  }
379 
380  if (highres) {
381  source = manta_noise_get_flame(fds->fluid);
382  }
383  else {
384  source = manta_smoke_get_flame(fds->fluid);
385  }
386 
387  GPUTexture *tex = create_volume_texture(dim, GPU_R8, GPU_DATA_FLOAT, source);
388  swizzle_texture_channel_single(tex);
389  return tex;
390 }
391 
392 static bool get_smoke_velocity_field(FluidDomainSettings *fds,
393  float **r_velocity_x,
394  float **r_velocity_y,
395  float **r_velocity_z)
396 {
397  const char vector_field = fds->vector_field;
398  switch ((FLUID_DisplayVectorField)vector_field) {
400  *r_velocity_x = manta_get_velocity_x(fds->fluid);
401  *r_velocity_y = manta_get_velocity_y(fds->fluid);
402  *r_velocity_z = manta_get_velocity_z(fds->fluid);
403  break;
405  *r_velocity_x = manta_get_guide_velocity_x(fds->fluid);
406  *r_velocity_y = manta_get_guide_velocity_y(fds->fluid);
407  *r_velocity_z = manta_get_guide_velocity_z(fds->fluid);
408  break;
410  *r_velocity_x = manta_get_force_x(fds->fluid);
411  *r_velocity_y = manta_get_force_y(fds->fluid);
412  *r_velocity_z = manta_get_force_z(fds->fluid);
413  break;
414  }
415 
416  return *r_velocity_x && *r_velocity_y && *r_velocity_z;
417 }
418 
419 #endif /* WITH_FLUID */
420 
423 /* -------------------------------------------------------------------- */
428 {
429 #ifndef WITH_FLUID
430  UNUSED_VARS(fmd);
431 #else
432  if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
433  FluidDomainSettings *fds = fmd->domain;
434 
435  if (!fds->tex_field) {
436  fds->tex_field = create_field_texture(fds, false);
438  }
439  if (!fds->tex_coba && !ELEM(fds->coba_field,
446  fds->tex_coba = create_transfer_function(TFUNC_COLOR_RAMP, fds->coba);
448  }
449  }
450 #endif
451 }
452 
453 void DRW_smoke_ensure(FluidModifierData *fmd, int highres)
454 {
455 #ifndef WITH_FLUID
456  UNUSED_VARS(fmd, highres);
457 #else
458  if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
459  FluidDomainSettings *fds = fmd->domain;
460 
461  if (!fds->tex_density) {
462  fds->tex_density = create_density_texture(fds, highres);
464  }
465  if (!fds->tex_color) {
466  fds->tex_color = create_color_texture(fds, highres);
468  }
469  if (!fds->tex_flame) {
470  fds->tex_flame = create_flame_texture(fds, highres);
472  }
473  if (!fds->tex_flame_coba && fds->tex_flame) {
474  fds->tex_flame_coba = create_transfer_function(TFUNC_FLAME_SPECTRUM, NULL);
476  }
477  if (!fds->tex_shadow) {
478  fds->tex_shadow = create_volume_texture(
481  }
482  }
483 #endif /* WITH_FLUID */
484 }
485 
487 {
488 #ifndef WITH_FLUID
489  UNUSED_VARS(fmd);
490 #else
491  if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
492  FluidDomainSettings *fds = fmd->domain;
493  float *vel_x = NULL, *vel_y = NULL, *vel_z = NULL;
494 
495  if (!get_smoke_velocity_field(fds, &vel_x, &vel_y, &vel_z)) {
497  get_smoke_velocity_field(fds, &vel_x, &vel_y, &vel_z);
498  }
499 
500  if (ELEM(NULL, vel_x, vel_y, vel_z)) {
501  return;
502  }
503 
504  if (!fds->tex_velocity_x) {
506  "velx", UNPACK3(fds->res), 1, GPU_R16F, GPU_DATA_FLOAT, vel_x);
508  "vely", UNPACK3(fds->res), 1, GPU_R16F, GPU_DATA_FLOAT, vel_y);
510  "velz", UNPACK3(fds->res), 1, GPU_R16F, GPU_DATA_FLOAT, vel_z);
514  }
515  }
516 #endif /* WITH_FLUID */
517 }
518 
520 {
521 #ifndef WITH_FLUID
522  UNUSED_VARS(fmd);
523 #else
524  if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
525  FluidDomainSettings *fds = fmd->domain;
526  if (!fds->tex_flags) {
527  fds->tex_flags = create_volume_texture(
530 
531  swizzle_texture_channel_single(fds->tex_flags);
532  }
533  }
534 #endif /* WITH_FLUID */
535 }
536 
538 {
539 #ifndef WITH_FLUID
540  UNUSED_VARS(fmd);
541 #else
542  if (fmd->type & MOD_FLUID_TYPE_DOMAIN) {
543  FluidDomainSettings *fds = fmd->domain;
544 
545  if (!fds->tex_range_field) {
546  fds->tex_range_field = create_field_texture(fds, true);
548  }
549  }
550 #endif /* WITH_FLUID */
551 }
552 
553 void DRW_smoke_init(DRWData *drw_data)
554 {
556 }
557 
558 void DRW_smoke_exit(DRWData *drw_data)
559 {
560  /* Free Smoke Textures after rendering */
561  /* XXX This is a waste of processing and GPU bandwidth if nothing
562  * is updated. But the problem is since Textures are stored in the
563  * modifier we don't want them to take precious VRAM if the
564  * modifier is not used for display. We should share them for
565  * all viewport in a redraw at least. */
566  LISTBASE_FOREACH (LinkData *, link, &drw_data->smoke_textures) {
567  GPU_TEXTURE_FREE_SAFE(*(GPUTexture **)link->data);
568  }
569  BLI_freelistN(&drw_data->smoke_textures);
570 }
571 
typedef float(TangentPoint)[2]
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4])
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
Definition: BLI_listbase.h:273
struct LinkData * BLI_genericNodeN(void *data)
Definition: listbase.c:842
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
MINLINE int max_ii(int a, int b)
MINLINE void straight_to_premul_v4(float color[4])
MINLINE bool equals_v3v3_int(const int v1[3], const int v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v4(float r[4])
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNUSED_VARS(...)
#define UNPACK3(a)
#define ELEM(...)
@ FLUID_DOMAIN_FIELD_COLOR_B
@ FLUID_DOMAIN_FIELD_FLAME
@ FLUID_DOMAIN_FIELD_REACT
@ FLUID_DOMAIN_FIELD_PHI_OUT
@ FLUID_DOMAIN_FIELD_FORCE_Z
@ FLUID_DOMAIN_FIELD_PHI_OBSTACLE
@ FLUID_DOMAIN_FIELD_FLAGS
@ FLUID_DOMAIN_FIELD_VELOCITY_Z
@ FLUID_DOMAIN_FIELD_FORCE_Y
@ FLUID_DOMAIN_FIELD_PHI
@ FLUID_DOMAIN_FIELD_PRESSURE
@ FLUID_DOMAIN_FIELD_VELOCITY_X
@ FLUID_DOMAIN_FIELD_DENSITY
@ FLUID_DOMAIN_FIELD_VELOCITY_Y
@ FLUID_DOMAIN_FIELD_PHI_IN
@ FLUID_DOMAIN_FIELD_HEAT
@ FLUID_DOMAIN_FIELD_COLOR_G
@ FLUID_DOMAIN_FIELD_FORCE_X
@ FLUID_DOMAIN_FIELD_FUEL
@ FLUID_DOMAIN_FIELD_COLOR_R
FLUID_DisplayVectorField
@ FLUID_DOMAIN_VECTOR_FIELD_FORCE
@ FLUID_DOMAIN_VECTOR_FIELD_VELOCITY
@ FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY
@ MOD_FLUID_TYPE_DOMAIN
_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
void GPU_texture_swizzle_set(GPUTexture *tex, const char swizzle[4])
Definition: gpu_texture.cc:553
void GPU_texture_update_sub(GPUTexture *tex, eGPUDataFormat data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth)
Definition: gpu_texture.cc:417
GPUTexture * GPU_texture_create_1d(const char *name, int w, int mip_len, eGPUTextureFormat format, const float *data)
Definition: gpu_texture.cc:278
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
eGPUDataFormat
Definition: GPU_texture.h:170
@ GPU_DATA_INT
Definition: GPU_texture.h:172
@ GPU_DATA_FLOAT
Definition: GPU_texture.h:171
void GPU_texture_free(GPUTexture *tex)
Definition: gpu_texture.cc:564
#define GPU_TEXTURE_FREE_SAFE(texture)
Definition: GPU_texture.h:40
eGPUTextureFormat
Definition: GPU_texture.h:83
@ GPU_SRGB8_A8
Definition: GPU_texture.h:121
@ GPU_R16F
Definition: GPU_texture.h:113
@ GPU_R8UI
Definition: GPU_texture.h:105
@ GPU_R8
Definition: GPU_texture.h:107
@ GPU_RGBA8
Definition: GPU_texture.h:87
GPUTexture * GPU_texture_create_3d(const char *name, int w, int h, int d, int mip_len, eGPUTextureFormat texture_format, eGPUDataFormat data_format, const void *data)
Definition: gpu_texture.cc:309
GPUTexture * GPU_texture_create_error(int dimension, bool array)
Definition: gpu_texture.cc:374
void IMB_colormanagement_blackbody_temperature_to_rgb_table(float *r_table, int width, float min, float max)
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 a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
void DRW_fluid_ensure_flags(FluidModifierData *fmd)
Definition: draw_fluid.c:519
void DRW_smoke_ensure_coba_field(FluidModifierData *fmd)
Definition: draw_fluid.c:427
void DRW_fluid_ensure_range_field(FluidModifierData *fmd)
Definition: draw_fluid.c:537
void DRW_smoke_ensure(FluidModifierData *fmd, int highres)
Definition: draw_fluid.c:453
void DRW_smoke_ensure_velocity(FluidModifierData *fmd)
Definition: draw_fluid.c:486
void DRW_smoke_exit(DRWData *drw_data)
Definition: draw_fluid.c:558
void DRW_smoke_init(DRWData *drw_data)
Definition: draw_fluid.c:553
DRWManager DST
Definition: draw_manager.c:104
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx GPU_R32F
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
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)
float * manta_get_phiobs_in(struct MANTA *fluid)
float * manta_smoke_get_color_b(struct MANTA *smoke)
float * manta_smoke_get_fuel(struct MANTA *smoke)
float * manta_smoke_get_heat(struct MANTA *smoke)
bool manta_noise_has_colors(struct MANTA *smoke)
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)
float * manta_get_force_x(struct MANTA *fluid)
float * manta_get_velocity_x(struct MANTA *fluid)
float * manta_smoke_get_flame(struct MANTA *smoke)
int * manta_smoke_get_flags(struct MANTA *smoke)
float * manta_get_phi_in(struct MANTA *fluid)
float * manta_get_velocity_y(struct MANTA *fluid)
void manta_noise_get_rgba(struct MANTA *smoke, float *data, int sequential)
bool manta_noise_has_fuel(struct MANTA *smoke)
float * manta_get_phi(struct MANTA *fluid)
float * manta_get_force_z(struct MANTA *fluid)
float * manta_get_pressure(struct MANTA *fluid)
float * manta_noise_get_density(struct MANTA *smoke)
float * manta_get_guide_velocity_x(struct MANTA *fluid)
float * manta_get_phiout_in(struct MANTA *fluid)
float * manta_noise_get_flame(struct MANTA *smoke)
bool manta_smoke_has_colors(struct MANTA *smoke)
float * manta_get_velocity_z(struct MANTA *fluid)
bool manta_smoke_has_fuel(struct MANTA *smoke)
float * manta_smoke_get_react(struct MANTA *smoke)
int manta_noise_get_cells(struct MANTA *smoke)
float * manta_get_guide_velocity_y(struct MANTA *fluid)
void manta_smoke_get_rgba(struct MANTA *smoke, float *data, int sequential)
ListBase smoke_textures
Definition: draw_manager.h:535
DRWData * vmempool
Definition: draw_manager.h:562
struct GPUTexture * tex_density
struct GPUTexture * tex_range_field
struct GPUTexture * tex_velocity_x
struct GPUTexture * tex_color
struct GPUTexture * tex_velocity_y
struct GPUTexture * tex_field
struct MANTA * fluid
struct GPUTexture * tex_velocity_z
struct GPUTexture * tex_shadow
struct ColorBand * coba
struct GPUTexture * tex_flags
struct GPUTexture * tex_coba
struct GPUTexture * tex_flame
struct GPUTexture * tex_flame_coba
struct FluidDomainSettings * domain