|
Blender V4.3
|
#include <draw_view.hh>
Public Member Functions | |
| View (const char *name, int view_len=1, bool procedural=false) | |
| View (const char *name, const DRWView *view) | |
| void | sync (const float4x4 &view_mat, const float4x4 &win_mat, int view_id=0) |
| void | sync (const DRWView *view) |
| void | visibility_test (bool enable) |
| void | compute_procedural_bounds () |
| bool | is_persp (int view_id=0) const |
| bool | is_inverted (int view_id=0) const |
| float | far_clip (int view_id=0) const |
| float | near_clip (int view_id=0) const |
| const float3 & | location (int view_id=0) const |
| const float3 & | forward (int view_id=0) const |
| const float4x4 & | viewmat (int view_id=0) const |
| const float4x4 & | viewinv (int view_id=0) const |
| const float4x4 & | winmat (int view_id=0) const |
| const float4x4 & | wininv (int view_id=0) const |
| const float4x4 | persmat (int view_id=0) const |
| int | visibility_word_per_draw () const |
| UniformArrayBuffer< ViewMatrices, DRW_VIEW_MAX > & | matrices_ubo_get () |
Protected Member Functions | |
| void | bind () |
| virtual void | compute_visibility (ObjectBoundsBuf &bounds, ObjectInfosBuf &infos, uint resource_len, bool debug_freeze) |
| virtual VisibilityBuf & | get_visibility_buffer () |
| void | update_viewport_size () |
| void | frustum_boundbox_calc (int view_id) |
| void | frustum_culling_planes_calc (int view_id) |
| void | frustum_culling_sphere_calc (int view_id) |
Protected Attributes | |
| UniformArrayBuffer< ViewMatrices, DRW_VIEW_MAX > | data_ |
| UniformArrayBuffer< ViewCullingData, DRW_VIEW_MAX > | culling_ |
| UniformArrayBuffer< ViewMatrices, DRW_VIEW_MAX > | data_freeze_ |
| UniformArrayBuffer< ViewCullingData, DRW_VIEW_MAX > | culling_freeze_ |
| VisibilityBuf | visibility_buf_ |
| const char * | debug_name_ |
| int | view_len_ = 0 |
| bool | is_inverted_ = false |
| bool | do_visibility_ = true |
| bool | dirty_ = true |
| bool | frozen_ = false |
| bool | procedural_ = false |
Definition at line 34 of file draw_view.hh.
Definition at line 59 of file draw_view.hh.
References BLI_assert, and DRW_VIEW_MAX.
|
inline |
Definition at line 66 of file draw_view.hh.
References sync().
|
protected |
Called from draw manager.
Definition at line 221 of file draw_view.cc.
References culling_, data_, dirty_, DRW_VIEW_CULLING_UBO_SLOT, DRW_VIEW_UBO_SLOT, GPU_uniformbuf_bind(), procedural_, and blender::draw::detail::UniformCommon< T, len, device_only >::push_update().
| void blender::draw::View::compute_procedural_bounds | ( | ) |
Update culling data using a compute shader. This is to be used if the matrices were updated externally on the GPU (not using the sync() method).
Definition at line 233 of file draw_view.cc.
References culling_, data_, DRW_shader_draw_view_finalize_get(), DRW_VIEW_UBO_SLOT, GPU_BARRIER_UNIFORM, GPU_compute_dispatch(), GPU_debug_group_begin(), GPU_debug_group_end(), GPU_memory_barrier(), GPU_shader_bind(), GPU_shader_get_ssbo_binding(), GPU_uniformbuf_bind(), and GPU_uniformbuf_bind_as_ssbo().
Referenced by blender::eevee::ShadowModule::set_view().
|
protectedvirtual |
Definition at line 247 of file draw_view.cc.
References ceil_to_multiple_u(), culling_, culling_freeze_, data_, data_freeze_, divide_ceil_u(), do_visibility_, drw_debug_matrix_as_bbox, DRW_shader_draw_visibility_compute_get(), DRW_VIEW_CULLING_UBO_SLOT, DRW_VIEW_UBO_SLOT, DRW_VISIBILITY_GROUP_SIZE, frozen_, GPU_BARRIER_SHADER_STORAGE, GPU_compute_dispatch(), GPU_debug_group_begin(), GPU_debug_group_end(), GPU_memory_barrier(), GPU_shader_bind(), GPU_shader_get_ssbo_binding(), GPU_shader_uniform_1i(), GPU_storagebuf_bind(), GPU_storagebuf_clear(), GPU_uniformbuf_bind(), blender::math::invert(), max_ii(), persmat(), blender::draw::detail::UniformCommon< T, len, device_only >::push_update(), blender::draw::StorageArrayBuffer< T, len, device_only >::resize(), view_len_, visibility_buf_, and visibility_word_per_draw().
Definition at line 103 of file draw_view.hh.
References BLI_assert, data_, is_persp(), view_len_, and winmat().
Definition at line 127 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
|
protected |
Definition at line 44 of file draw_view.cc.
References ARRAY_SIZE, BKE_boundbox_init_from_minmax(), culling_, data_, is_persp(), left, mul_project_m4_v3(), projmat_dimensions(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), top, blender::math::transform_point(), and winmat().
Referenced by sync().
|
protected |
Definition at line 90 of file draw_view.cc.
References culling_, data_, blender::math::length(), persmat(), planes_from_projmat(), and blender::MatBase< T, NumCol, NumRow, Alignment >::ptr().
Referenced by sync().
|
protected |
Definition at line 106 of file draw_view.cc.
References add_v3_v3(), ARRAY_SIZE, BoundSphere::center, CLAMP, copy_v3_fl3(), copy_v3_v3(), culling_, data_, e, interp_v3_v3v3(), len, len_squared_v3(), len_squared_v3v3(), len_v2(), len_v3v3(), mid_v3_v3v3(), mul_m4_v3(), mul_v2_v2fl(), mul_v3_fl(), mul_v3_project_m4_v3(), N, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), BoundSphere::radius, sub_v2_v2(), viewinv(), wininv(), winmat(), and z().
Referenced by sync().
|
protectedvirtual |
Definition at line 304 of file draw_view.cc.
References visibility_buf_.
|
inline |
Definition at line 96 of file draw_view.hh.
References BLI_assert, is_inverted_, UNUSED_VARS_NDEBUG, and view_len_.
|
inline |
Definition at line 90 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
Referenced by blender::eevee::VolumeModule::draw_prepass(), far_clip(), frustum_boundbox_calc(), and near_clip().
Definition at line 121 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
|
inline |
Definition at line 169 of file draw_view.hh.
References data_.
Referenced by blender::eevee::ShadowModule::end_sync(), and blender::eevee::ShadowModule::set_view().
Definition at line 112 of file draw_view.hh.
References BLI_assert, data_, is_persp(), view_len_, and winmat().
Definition at line 158 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
Referenced by compute_visibility(), frustum_culling_planes_calc(), and blender::eevee::RayTraceModule::render().
| void blender::draw::View::sync | ( | const DRWView * | view | ) |
Definition at line 36 of file draw_view.cc.
References DRW_view_viewmat_get(), DRW_view_winmat_get(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), and sync().
| void blender::draw::View::sync | ( | const float4x4 & | view_mat, |
| const float4x4 & | win_mat, | ||
| int | view_id = 0 ) |
Definition at line 20 of file draw_view.cc.
References data_, dirty_, frustum_boundbox_calc(), frustum_culling_planes_calc(), frustum_culling_sphere_calc(), blender::math::invert(), is_inverted_, is_negative_m4(), and blender::MatBase< T, NumCol, NumRow, Alignment >::ptr().
Referenced by blender::draw::overlay::Curves::draw(), blender::draw::overlay::EditText::draw(), blender::draw::overlay::Meshes::draw(), blender::draw::overlay::Curves::draw_color_only(), blender::draw::overlay::GreasePencil::draw_color_only(), blender::draw::overlay::Meshes::draw_color_only(), blender::draw::overlay::Cameras::draw_in_front(), blender::eevee::VolumeModule::draw_prepass(), blender::eevee::LookdevView::render(), blender::eevee::PlanarProbeModule::set_view(), sync(), blender::eevee::ShadingView::sync(), blender::draw::test_eevee_surfel_list(), and View().
|
protected |
Definition at line 139 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
Referenced by blender::eevee::VolumeModule::draw_prepass(), and frustum_culling_sphere_calc().
Definition at line 133 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
Referenced by blender::eevee::VolumeModule::draw_compute(), blender::eevee::VolumeModule::draw_prepass(), blender::eevee::PlanarProbe::set_view(), and blender::eevee::Camera::sync().
|
inline |
Enable or disable every visibility test (frustum culling, HiZ culling).
Definition at line 78 of file draw_view.hh.
References do_visibility_.
Referenced by blender::eevee::VolumeModule::draw_prepass().
|
inline |
Definition at line 164 of file draw_view.hh.
References divide_ceil_u(), and view_len_.
Referenced by compute_visibility().
Definition at line 151 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
Referenced by frustum_culling_sphere_calc().
Definition at line 145 of file draw_view.hh.
References BLI_assert, data_, and view_len_.
Referenced by blender::eevee::VolumeModule::draw_prepass(), far_clip(), frustum_boundbox_calc(), frustum_culling_sphere_calc(), near_clip(), and blender::eevee::PlanarProbe::set_view().
|
protected |
Definition at line 41 of file draw_view.hh.
Referenced by bind(), compute_procedural_bounds(), compute_visibility(), frustum_boundbox_calc(), frustum_culling_planes_calc(), and frustum_culling_sphere_calc().
|
protected |
Definition at line 44 of file draw_view.hh.
Referenced by compute_visibility().
|
protected |
TODO(fclem): Maybe try to reduce the minimum cost if the number of view is lower.
Definition at line 40 of file draw_view.hh.
Referenced by bind(), compute_procedural_bounds(), compute_visibility(), far_clip(), forward(), frustum_boundbox_calc(), frustum_culling_planes_calc(), frustum_culling_sphere_calc(), is_persp(), location(), matrices_ubo_get(), near_clip(), persmat(), sync(), viewinv(), viewmat(), wininv(), and winmat().
|
protected |
Frozen version of data_ used for debugging culling.
Definition at line 43 of file draw_view.hh.
Referenced by compute_visibility().
|
protected |
Definition at line 48 of file draw_view.hh.
|
protected |
Definition at line 54 of file draw_view.hh.
|
protected |
Definition at line 53 of file draw_view.hh.
Referenced by compute_visibility(), and visibility_test().
|
protected |
Definition at line 55 of file draw_view.hh.
Referenced by compute_visibility().
|
protected |
Definition at line 52 of file draw_view.hh.
Referenced by is_inverted(), and sync().
|
protected |
Definition at line 56 of file draw_view.hh.
Referenced by bind().
|
protected |
Definition at line 50 of file draw_view.hh.
Referenced by compute_visibility(), far_clip(), forward(), is_inverted(), is_persp(), location(), near_clip(), persmat(), viewinv(), viewmat(), visibility_word_per_draw(), wininv(), and winmat().
|
protected |
Result of the visibility computation. 1 bit or 1 or 2 word per resource ID per view.
Definition at line 46 of file draw_view.hh.
Referenced by compute_visibility(), and get_visibility_buffer().