Blender V5.0
blender::eevee::View Class Reference

#include <draw_view.hh>

Classes

struct  OffsetData

Public Member Functions

 View (const char *name, int view_len=1, bool procedural=false)
virtual ~View ()=default
void sync (const float4x4 &view_mat, const float4x4 &win_mat, int view_id=0)
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 float3location (int view_id=0) const
const float3forward (int view_id=0) const
const float4x4viewmat (int view_id=0) const
const float4x4viewinv (int view_id=0) const
const float4x4winmat (int view_id=0) const
const float4x4wininv (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 ()
std::array< float4, 6 > frustum_planes_get (int view_id=0)
std::array< float3, 8 > frustum_corners_get (int view_id=0)

Static Public Member Functions

static Viewdefault_get ()
static void default_set (const float4x4 &view_mat, const float4x4 &win_mat)

Protected Member Functions

void bind ()
virtual void compute_visibility (ObjectBoundsBuf &bounds, ObjectInfosBuf &infos, uint resource_len, bool debug_freeze)
virtual VisibilityBufget_visibility_buffer ()
bool has_computed_visibility () const
uint64_t fingerprint_get () const
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_MAXdata_
UniformArrayBuffer< ViewCullingData, DRW_VIEW_MAXculling_
UniformArrayBuffer< ViewMatrices, DRW_VIEW_MAXdata_freeze_
UniformArrayBuffer< ViewCullingData, DRW_VIEW_MAXculling_freeze_
VisibilityBuf visibility_buf_
uint64_t manager_fingerprint_ = 0
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

Detailed Description

Definition at line 37 of file draw_view.hh.

Constructor & Destructor Documentation

◆ View()

blender::draw::View::View ( const char * name,
int view_len = 1,
bool procedural = false )
inline

Definition at line 70 of file draw_view.hh.

◆ ~View()

virtual blender::draw::View::~View ( )
virtualdefault

Member Function Documentation

◆ bind()

void blender::draw::View::bind ( )
protected

Called from draw manager.

Definition at line 226 of file draw_view.cc.

◆ 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 238 of file draw_view.cc.

◆ compute_visibility()

void blender::draw::View::compute_visibility ( ObjectBoundsBuf & bounds,
ObjectInfosBuf & infos,
uint resource_len,
bool debug_freeze )
protectedvirtual

Definition at line 257 of file draw_view.cc.

◆ default_get()

Definition at line 317 of file draw_view.cc.

◆ default_set()

void blender::draw::View::default_set ( const float4x4 & view_mat,
const float4x4 & win_mat )
static

Definition at line 322 of file draw_view.cc.

◆ far_clip()

float blender::draw::View::far_clip ( int view_id = 0) const
inline

Definition at line 106 of file draw_view.hh.

◆ fingerprint_get()

Definition at line 249 of file draw_view.hh.

◆ forward()

const float3 & blender::draw::View::forward ( int view_id = 0) const
inline

Definition at line 130 of file draw_view.hh.

◆ frustum_boundbox_calc()

void blender::draw::View::frustum_boundbox_calc ( int view_id)
protected

Definition at line 46 of file draw_view.cc.

◆ frustum_corners_get()

std::array< float3, 8 > blender::draw::View::frustum_corners_get ( int view_id = 0)

Definition at line 337 of file draw_view.cc.

◆ frustum_culling_planes_calc()

void blender::draw::View::frustum_culling_planes_calc ( int view_id)
protected

Definition at line 92 of file draw_view.cc.

◆ frustum_culling_sphere_calc()

void blender::draw::View::frustum_culling_sphere_calc ( int view_id)
protected

Definition at line 111 of file draw_view.cc.

◆ frustum_planes_get()

std::array< float4, 6 > blender::draw::View::frustum_planes_get ( int view_id = 0)

Definition at line 327 of file draw_view.cc.

◆ get_visibility_buffer()

Definition at line 312 of file draw_view.cc.

◆ has_computed_visibility()

bool blender::draw::View::has_computed_visibility ( ) const
inlineprotected

Definition at line 239 of file draw_view.hh.

◆ is_inverted()

bool blender::draw::View::is_inverted ( int view_id = 0) const
inline

Definition at line 99 of file draw_view.hh.

◆ is_persp()

bool blender::draw::View::is_persp ( int view_id = 0) const
inline

Definition at line 93 of file draw_view.hh.

◆ location()

const float3 & blender::draw::View::location ( int view_id = 0) const
inline

Definition at line 124 of file draw_view.hh.

◆ matrices_ubo_get()

◆ near_clip()

float blender::draw::View::near_clip ( int view_id = 0) const
inline

Definition at line 115 of file draw_view.hh.

◆ persmat()

const float4x4 blender::draw::View::persmat ( int view_id = 0) const
inline

Definition at line 161 of file draw_view.hh.

◆ sync()

void blender::draw::View::sync ( const float4x4 & view_mat,
const float4x4 & win_mat,
int view_id = 0 )

Definition at line 27 of file draw_view.cc.

◆ update_viewport_size()

◆ viewinv()

const float4x4 & blender::draw::View::viewinv ( int view_id = 0) const
inline

Definition at line 142 of file draw_view.hh.

◆ viewmat()

const float4x4 & blender::draw::View::viewmat ( int view_id = 0) const
inline

Definition at line 136 of file draw_view.hh.

◆ visibility_test()

void blender::draw::View::visibility_test ( bool enable)
inline

Enable or disable every visibility test (frustum culling, HiZ culling).

Definition at line 81 of file draw_view.hh.

◆ visibility_word_per_draw()

Definition at line 167 of file draw_view.hh.

◆ wininv()

const float4x4 & blender::draw::View::wininv ( int view_id = 0) const
inline

Definition at line 154 of file draw_view.hh.

◆ winmat()

const float4x4 & blender::draw::View::winmat ( int view_id = 0) const
inline

Definition at line 148 of file draw_view.hh.

Member Data Documentation

◆ culling_

◆ culling_freeze_

◆ data_

TODO(fclem): Maybe try to reduce the minimum cost if the number of view is lower.

Definition at line 49 of file draw_view.hh.

◆ data_freeze_

Frozen version of data_ used for debugging culling.

Definition at line 52 of file draw_view.hh.

◆ debug_name_

const char* blender::draw::View::debug_name_
protected

Definition at line 59 of file draw_view.hh.

◆ dirty_

Definition at line 65 of file draw_view.hh.

◆ do_visibility_

Definition at line 64 of file draw_view.hh.

◆ frozen_

Definition at line 66 of file draw_view.hh.

◆ is_inverted_

Definition at line 63 of file draw_view.hh.

◆ manager_fingerprint_

Definition at line 57 of file draw_view.hh.

◆ procedural_

Definition at line 67 of file draw_view.hh.

◆ view_len_

int blender::draw::View::view_len_ = 0
protected

Definition at line 61 of file draw_view.hh.

◆ visibility_buf_

Result of the visibility computation. 1 bit or 1 or 2 word per resource ID per view.

Definition at line 55 of file draw_view.hh.


The documentation for this class was generated from the following files: