37 if (volume_grid ==
nullptr) {
42 if (grid ==
nullptr) {
81 draw_volume_ps(manager, sub_ps, ob_ref, scene_state.
sample, slice_count, world_size);
96 if (!settings.
fluid) {
100 bool can_load =
false;
103 can_load = settings.
tex_field !=
nullptr;
145 if (!show_flags && !show_pressure && !show_phi) {
178 draw_volume_ps(manager, sub_ps, ob_ref, scene_state.
sample, slice_count, world_size);
195void VolumePass::draw_slice_ps(
208 float step_length = std::max(1e-16f, dimensions[axis] * 0.05f);
218void VolumePass::draw_volume_ps(Manager &manager,
228 int max_slice = std::max({
UNPACK3(slice_count)});
229 float step_length =
math::length((1.0f / slice_count) * world_size);
232 ps.push_constant(
"samplesLen", max_slice);
233 ps.push_constant(
"stepLength", step_length);
234 ps.push_constant(
"noiseOfs",
float(noise_offset));
void BKE_object_dimensions_get(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_ACTIVE_COLORS
@ FLUID_DOMAIN_ACTIVE_COLOR_SET
@ FLUID_DOMAIN_FIELD_PHI_OUT
@ FLUID_DOMAIN_FIELD_PHI_OBSTACLE
@ FLUID_DOMAIN_FIELD_FLAGS
@ FLUID_DOMAIN_FIELD_PRESSURE
@ FLUID_DOMAIN_FIELD_PHI_IN
#define GPU_ATTACHMENT_TEXTURE(_texture)
#define GPU_ATTACHMENT_NONE
@ GPU_TEXTURE_USAGE_SHADER_READ
void GPU_texture_get_mipmap_size(GPUTexture *texture, int mip_level, int *r_size)
void submit(PassSimple &pass, View &view)
ResourceHandle resource_handle(const ObjectRef &ref, float inflate_bounds=0.0f)
void bind_texture(const char *name, GPUTexture *texture, GPUSamplerState state=sampler_auto)
void draw(gpu::Batch *batch, uint instance_len=-1, uint vertex_len=-1, uint vertex_first=-1, ResourceHandle handle={0}, uint custom_id=0)
void state_set(DRWState state, int clip_plane_count=0)
void push_constant(const char *name, const float &data)
void shader_set(GPUShader *shader)
detail::PassBase< command::DrawMultiBuf > Sub
static ShaderCache & get()
GPUTexture * extract(Manager &manager, Texture &stencil_src)
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)
blender::gpu::Batch * DRW_cache_quad_get()
blender::gpu::Batch * DRW_cache_cube_get()
void DRW_smoke_ensure_coba_field(FluidModifierData *fmd)
void DRW_smoke_ensure(FluidModifierData *fmd, int highres)
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
@ DRW_STATE_BLEND_ALPHA_PREMUL
RAYTRACE_GROUP_SIZE additional_info("eevee_shared", "eevee_gbuffer_data", "eevee_global_ubo", "eevee_sampling_data", "eevee_utility_texture", "eevee_hiz_data", "draw_view") .specialization_constant(Type RAYTRACE_GROUP_SIZE in_sh_0_tx in_sh_2_tx screen_normal_tx GPU_RGBA8
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
blender::float4x4 object_to_texture
blender::float4x4 texture_to_object
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
const c_style_mat & ptr() const
StencilViewWorkaround stencil_view
UniformBuffer< WorldData > world_buf