46 const float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f};
47 const float one[4] = {1.0f, 1.0f, 1.0f, 1.0f};
120 float invviewmat[4][4];
129 float step_length =
max_ff(1e-16f, dim[axis] * 0.05f);
141 float dim[3], step_length, max_slice;
142 float slice_ct[3] = {fds->
res[0], fds->
res[1], fds->
res[2]};
144 max_slice =
max_fff(slice_ct[0], slice_ct[1], slice_ct[2]);
148 step_length =
len_v3(dim);
165 if (!show_phi && !show_flags && !show_pressure) {
174 static float white[3] = {1.0f, 1.0f, 1.0f};
185 grp,
"activeColor", (use_constant_color) ? fds->
active_color : white, 1);
219 if (volume_grid ==
NULL) {
256 float texture_to_world[4][4];
260 float invviewmat[4][4];
270 float step_length =
max_ff(1e-16f, dim[axis] * 0.05f);
290 float step_length, max_slice;
293 float slice_ct[3] = {resolution[0], resolution[1], resolution[2]};
295 max_slice =
max_fff(slice_ct[0], slice_ct[1], slice_ct[2]);
298 step_length =
len_v3(slice_ct);
struct Material * BKE_object_material_get(struct Object *ob, short act)
General operations, lookup, etc. for blender objects.
void BKE_object_dimensions_get(struct Object *ob, float r_vec[3])
const VolumeGrid * BKE_volume_grid_active_get_for_read(const struct Volume *volume)
bool BKE_volume_load(const struct Volume *volume, const struct Main *bmain)
Volume data-block rendering and viewport drawing utilities.
float BKE_volume_density_scale(const struct Volume *volume, const float matrix[4][4])
A dynamically sized string ADT.
#define LISTBASE_FOREACH(type, var, list)
struct LinkData * BLI_genericNodeN(void *data)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float max_fff(float a, float b, float c)
MINLINE float max_ff(float a, float b)
MINLINE int axis_dominant_v3_single(const float vec[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void mat4_to_size(float size[3], const float M[4][4])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void abs_v3(float r[3])
MINLINE void invert_v3(float r[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void BLI_halton_1d(unsigned int prime, double offset, int n, double *r)
@ FLUID_DOMAIN_FIELD_PHI_OUT
@ FLUID_DOMAIN_FIELD_PHI_OBSTACLE
@ FLUID_DOMAIN_FIELD_FLAGS
@ FLUID_DOMAIN_FIELD_PRESSURE
@ FLUID_DOMAIN_FIELD_PHI_IN
FLUID_DisplayInterpolationMethod
@ FLUID_DISPLAY_INTERP_CLOSEST
@ FLUID_DISPLAY_INTERP_CUBIC
@ FLUID_DISPLAY_INTERP_LINEAR
@ FLUID_DOMAIN_ACTIVE_COLORS
@ FLUID_DOMAIN_ACTIVE_COLOR_SET
VolumeDisplayInterpMethod
@ VOLUME_DISPLAY_INTERP_CLOSEST
@ VOLUME_DISPLAY_INTERP_LINEAR
@ VOLUME_DISPLAY_INTERP_CUBIC
#define VOLUME_MATERIAL_NR
@ DRW_STATE_BLEND_ALPHA_PREMUL
#define DRW_shgroup_call(shgroup, geom, ob)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
struct GPUShader GPUShader
GPUTexture * GPU_texture_create_1d(const char *name, int w, int mip_len, eGPUTextureFormat format, const float *data)
void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size)
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)
GPUBatch * DRW_cache_quad_get(void)
GPUBatch * DRW_cache_cube_get(void)
DRWVolumeGrid * DRW_volume_batch_cache_get_grid(struct Volume *volume, const struct VolumeGrid *grid)
void DRW_smoke_free(struct FluidModifierData *fmd)
void DRW_smoke_ensure_coba_field(struct FluidModifierData *fmd)
void DRW_smoke_ensure(struct FluidModifierData *fmd, int highres)
DefaultFramebufferList * DRW_viewport_framebuffer_list_get(void)
DefaultTextureList * DRW_viewport_texture_list_get(void)
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
void DRW_shgroup_uniform_block(DRWShadingGroup *shgroup, const char *name, const GPUUniformBuf *ubo)
void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state)
void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_vec3(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex)
DRWPass * DRW_pass_create(const char *name, DRWState state)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value)
void DRW_shgroup_uniform_mat4(DRWShadingGroup *shgroup, const char *name, const float(*value)[4])
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_draw_pass(DRWPass *pass)
float texture_to_object[4][4]
struct GPUTexture * texture
float object_to_texture[4][4]
struct GPUFrameBuffer * color_only_fb
struct GPUTexture * depth
struct GPUTexture * tex_density
struct GPUTexture * tex_color
struct GPUTexture * tex_field
struct GPUTexture * tex_shadow
struct GPUTexture * tex_coba
struct GPUTexture * tex_flame
struct GPUTexture * tex_flame_coba
struct FluidDomainSettings * domain
WORKBENCH_StorageList * stl
WORKBENCH_TextureList * txl
struct DRWPass * volume_ps
struct GPUUniformBuf * world_ubo
struct WORKBENCH_PrivateData * wpd
struct GPUTexture * dummy_coba_tx
struct GPUTexture * dummy_volume_tx
struct GPUTexture * dummy_shadow_tx
void workbench_material_ubo_data(WORKBENCH_PrivateData *wpd, Object *ob, Material *mat, WORKBENCH_UBO_Material *data, eV3DShadingColorType color_type)
eWORKBENCH_VolumeInterpType
@ WORKBENCH_VOLUME_INTERP_CUBIC
@ WORKBENCH_VOLUME_INTERP_LINEAR
@ WORKBENCH_VOLUME_INTERP_CLOSEST
GPUShader * workbench_shader_volume_get(bool slice, bool coba, eWORKBENCH_VolumeInterpType interp_type, bool smoke)
void workbench_volume_cache_init(WORKBENCH_Data *vedata)
void workbench_volume_draw_pass(WORKBENCH_Data *vedata)
void workbench_volume_draw_finish(WORKBENCH_Data *vedata)
static void workbench_volume_modifier_cache_populate(WORKBENCH_Data *vedata, Object *ob, ModifierData *md)
void workbench_volume_cache_populate(WORKBENCH_Data *vedata, Scene *UNUSED(scene), Object *ob, ModifierData *md, eV3DShadingColorType color_type)
static void workbench_volume_material_color(WORKBENCH_PrivateData *wpd, Object *ob, eV3DShadingColorType color_type, float color[3])
static void workbench_volume_object_cache_populate(WORKBENCH_Data *vedata, Object *ob, eV3DShadingColorType color_type)
void workbench_volume_engine_init(WORKBENCH_Data *vedata)