25 dummy_shadow_tx_.ensure_3d(
27 dummy_volume_tx_.ensure_3d(
29 dummy_coba_tx_.ensure_1d(
44 if (volume_grid ==
nullptr) {
49 if (grid ==
nullptr) {
89 manager, resources, sub_ps, ob_ref, scene_state.
sample, slice_count, world_size);
104 if (!settings.
fluid) {
108 bool can_load =
false;
111 can_load = settings.
tex_field !=
nullptr;
153 if (!show_flags && !show_pressure && !show_phi) {
186 manager, resources, sub_ps, ob_ref, scene_state.
sample, slice_count, world_size);
203void VolumePass::draw_slice_ps(
Manager &manager,
219 float step_length = std::max(1e-16f, dimensions[axis] * 0.05f);
229void VolumePass::draw_volume_ps(Manager &manager,
230 SceneResources &resources,
240 int max_slice = std::max({
UNPACK3(slice_count)});
241 float step_length =
math::length((1.0f / slice_count) * world_size);
244 ps.push_constant(
"samples_len", max_slice);
245 ps.push_constant(
"step_length", step_length);
246 ps.push_constant(
"noise_ofs",
float(noise_offset));
248 ps.draw(resources.volume_cube_batch, manager.unique_handle(ob_ref));
void BKE_object_dimensions_get(const Object *ob, float r_vec[3])
const blender::bke::VolumeGridData * BKE_volume_grid_active_get_for_read(const Volume *volume)
bool BKE_volume_load(const Volume *volume, const Main *bmain)
Volume data-block rendering and viewport drawing utilities.
float BKE_volume_density_scale(const Volume *volume, const float matrix[4][4])
MINLINE int axis_dominant_v3_single(const float vec[3])
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_DOMAIN_ACTIVE_COLORS
@ FLUID_DOMAIN_ACTIVE_COLOR_SET
T & DRW_object_get_data_for_drawing(const Object &object)
#define GPU_ATTACHMENT_TEXTURE(_texture)
#define GPU_ATTACHMENT_NONE
void GPU_texture_get_mipmap_size(blender::gpu::Texture *texture, int mip_level, int *r_size)
@ GPU_TEXTURE_USAGE_SHADER_READ
ResourceHandleRange unique_handle(const ObjectRef &ref)
void submit(PassSimple &pass, View &view)
gpu::Texture * stencil_view(bool cube_as_array=false)
static View & default_get()
const float4x4 & viewinv(int view_id=0) const
void shader_set(gpu::Shader *shader)
void bind_texture(const char *name, gpu::Texture *texture, GPUSamplerState state=sampler_auto)
void state_set(DRWState state, int clip_plane_count=0)
void draw(gpu::Batch *batch, uint instance_len=-1, uint vertex_len=-1, uint vertex_first=-1, ResourceIndexRange res_index={}, uint custom_id=0)
void push_constant(const char *name, const float &data)
detail::PassBase< command::DrawMultiBuf > Sub
static ShaderCache & get()
void sync(SceneResources &resources)
void object_sync_volume(Manager &manager, SceneResources &resources, const SceneState &scene_state, ObjectRef &ob_ref, float3 color)
void draw(Manager &manager, View &view, SceneResources &resources)
void object_sync_modifier(Manager &manager, SceneResources &resources, const SceneState &scene_state, ObjectRef &ob_ref, ModifierData *md)
void DRW_smoke_ensure_coba_field(FluidModifierData *fmd)
void DRW_smoke_ensure(FluidModifierData *fmd, int highres)
@ DRW_STATE_BLEND_ALPHA_PREMUL
DRWVolumeGrid * DRW_volume_batch_cache_get_grid(Volume *volume, const bke::VolumeGridData *volume_grid)
T length(const VecBase< T, Size > &a)
VecBase< T, 3 > to_scale(const MatBase< T, NumCol, NumRow > &mat)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< int32_t, 3 > int3
VecBase< float, 3 > float3
GPUTexture * tex_flame_coba
float4x4 texture_to_object
float4x4 object_to_texture
UniformBuffer< WorldData > world_buf
gpu::Batch * volume_cube_batch