Blender V4.3
blender::eevee::Instance Class Reference

A running instance of the engine. More...

#include <eevee_instance.hh>

Public Member Functions

 Instance ()
 
 ~Instance ()
 
template<typename... Args>
void info_append (const char *msg, Args &&...args)
 
template<typename... Args>
void info_append_i18n (const char *msg, Args &&...args)
 
const char * info_get ()
 
bool is_viewport () const
 
bool is_image_render () const
 
bool is_viewport_image_render () const
 
bool is_baking () const
 
bool overlays_enabled () const
 
bool gpencil_engine_enabled () const
 
bool is_playback () const
 
bool is_transforming () const
 
bool is_navigating () const
 
bool is_painting () const
 
bool use_scene_lights () const
 
bool use_studio_light () const
 
bool use_lookdev_overlay () const
 
int get_recalc_flags (const ObjectRef &ob_ref)
 
int get_recalc_flags (const ::World &world)
 

Public Attributes

ShaderModuleshaders
 
SyncModule sync
 
UniformDataModule uniform_data
 
MaterialModule materials
 
SubsurfaceModule subsurface
 
PipelineModule pipelines
 
ShadowModule shadows
 
LightModule lights
 
AmbientOcclusion ambient_occlusion
 
RayTraceModule raytracing
 
VelocityModule velocity
 
MotionBlurModule motion_blur
 
DepthOfField depth_of_field
 
Cryptomatte cryptomatte
 
GBuffer gbuffer
 
HiZBuffer hiz_buffer
 
Sampling sampling
 
Camera camera
 
Film film
 
RenderBuffers render_buffers
 
MainView main_view
 
CaptureView capture_view
 
World world
 
LookdevView lookdev_view
 
LookdevModule lookdev
 
SphereProbeModule sphere_probes
 
PlanarProbeModule planar_probes
 
VolumeProbeModule volume_probes
 
LightProbeModule light_probes
 
VolumeModule volume
 
Depsgraph * depsgraph
 
Managermanager
 
Scenescene
 
ViewLayerview_layer
 
Objectcamera_eval_object
 
Objectcamera_orig_object
 
const RenderLayerrender_layer
 
RenderEnginerender
 
const DRWViewdrw_view
 
const View3Dv3d
 
const RegionView3Drv3d
 
bool is_light_bake = false
 
bool use_surfaces = true
 
bool use_curves = true
 
bool use_volumes = true
 
eDebugMode debug_mode = eDebugMode::DEBUG_NONE
 

Initialization

Initialization functions need to be called once at the start of a frame. Active camera, render extent and enabled render passes are immutable until next init. This takes care of resizing output buffers and view in case a parameter changed. IMPORTANT: xxx.init() functions are NOT meant to acquire and allocate DRW resources. Any attempt to do so will likely produce use after free situations.

void init (const int2 &output_res, const rcti *output_rect, const rcti *visible_rect, RenderEngine *render, Depsgraph *depsgraph, Object *camera_object=nullptr, const RenderLayer *render_layer=nullptr, const DRWView *drw_view=nullptr, const View3D *v3d=nullptr, const RegionView3D *rv3d=nullptr)
 
void view_update ()
 
void init_light_bake (Depsgraph *depsgraph, draw::Manager *manager)
 

Sync

Sync will gather data from the scene that can change over a time step (i.e: motion steps). IMPORTANT: xxx.sync() functions area responsible for creating DRW resources (i.e: DRWView) as well as querying temp texture pool. All DRWPasses should be ready by the end end_sync().

void begin_sync ()
 
void object_sync (Object *ob)
 
void end_sync ()
 
bool do_lightprobe_sphere_sync () const
 
bool do_planar_probe_sync () const
 
bool needs_lightprobe_sphere_passes () const
 
bool needs_planar_probe_passes () const
 
void render_sync ()
 

Interface

void render_frame (RenderEngine *engine, RenderLayer *render_layer, const char *view_name)
 
void store_metadata (RenderResult *render_result)
 
void draw_viewport ()
 
void draw_viewport_image_render ()
 
void light_bake_irradiance (Object &probe, FunctionRef< void()> context_enable, FunctionRef< void()> context_disable, FunctionRef< bool()> stop, FunctionRef< void(LightProbeGridCacheFrame *, float progress)> result_update)
 
static void update_passes (RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
 

Detailed Description

A running instance of the engine.

Definition at line 68 of file eevee_instance.hh.

Constructor & Destructor Documentation

◆ Instance()

blender::eevee::Instance::Instance ( )
inline

Definition at line 145 of file eevee_instance.hh.

◆ ~Instance()

blender::eevee::Instance::~Instance ( )
inline

Definition at line 174 of file eevee_instance.hh.

Member Function Documentation

◆ begin_sync()

◆ do_lightprobe_sphere_sync()

bool blender::eevee::Instance::do_lightprobe_sphere_sync ( ) const

Return true when probe pipeline is used during this sample.

Definition at line 376 of file eevee_instance.cc.

References needs_lightprobe_sphere_passes().

Referenced by blender::eevee::SphereProbeModule::end_sync().

◆ do_planar_probe_sync()

bool blender::eevee::Instance::do_planar_probe_sync ( ) const

Definition at line 386 of file eevee_instance.cc.

References needs_planar_probe_passes().

◆ draw_viewport()

◆ draw_viewport_image_render()

void blender::eevee::Instance::draw_viewport_image_render ( )

Definition at line 599 of file eevee_instance.cc.

References blender::eevee::VelocityModule::step_swap(), and velocity.

Referenced by eevee_draw_scene().

◆ end_sync()

◆ get_recalc_flags() [1/2]

int blender::eevee::Instance::get_recalc_flags ( const ::World & world)
inline

Definition at line 351 of file eevee_instance.hh.

References ID_RECALC_SHADING, and int.

◆ get_recalc_flags() [2/2]

◆ gpencil_engine_enabled()

bool blender::eevee::Instance::gpencil_engine_enabled ( ) const
inline

True if the grease pencil engine might be running.

Definition at line 280 of file eevee_instance.hh.

References DEG_id_type_any_exists(), depsgraph, and ID_GP.

Referenced by blender::eevee::Film::init().

◆ info_append()

template<typename... Args>
void blender::eevee::Instance::info_append ( const char * msg,
Args &&... args )
inline

◆ info_append_i18n()

template<typename... Args>
void blender::eevee::Instance::info_append_i18n ( const char * msg,
Args &&... args )
inline

◆ info_get()

const char * blender::eevee::Instance::info_get ( )
inline

Definition at line 249 of file eevee_instance.hh.

Referenced by eevee_draw_scene(), and blender::eevee::LightBake::run().

◆ init()

void blender::eevee::Instance::init ( const int2 & output_res,
const rcti * output_rect,
const rcti * visible_rect,
RenderEngine * render,
Depsgraph * depsgraph,
Object * camera_object = nullptr,
const RenderLayer * render_layer = nullptr,
const DRWView * drw_view = nullptr,
const View3D * v3d = nullptr,
const RegionView3D * rv3d = nullptr )

◆ init_light_bake()

◆ is_baking()

◆ is_image_render()

◆ is_navigating()

bool blender::eevee::Instance::is_navigating ( ) const
inline

◆ is_painting()

bool blender::eevee::Instance::is_painting ( ) const
inline

Definition at line 301 of file eevee_instance.hh.

References DRW_state_is_painting().

Referenced by init().

◆ is_playback()

◆ is_transforming()

bool blender::eevee::Instance::is_transforming ( ) const
inline

◆ is_viewport()

◆ is_viewport_image_render()

bool blender::eevee::Instance::is_viewport_image_render ( ) const
inline

◆ light_bake_irradiance()

◆ needs_lightprobe_sphere_passes()

bool blender::eevee::Instance::needs_lightprobe_sphere_passes ( ) const

Return true when probe passes should be loaded. It can be true even if do_<type>_probe_sync() is false due to shaders still being compiled.

Definition at line 371 of file eevee_instance.cc.

References sphere_probes.

Referenced by do_lightprobe_sphere_sync().

◆ needs_planar_probe_passes()

bool blender::eevee::Instance::needs_planar_probe_passes ( ) const

Definition at line 381 of file eevee_instance.cc.

References planar_probes.

Referenced by do_planar_probe_sync().

◆ object_sync()

◆ overlays_enabled()

bool blender::eevee::Instance::overlays_enabled ( ) const
inline

◆ render_frame()

void blender::eevee::Instance::render_frame ( RenderEngine * engine,
RenderLayer * render_layer,
const char * view_name )

◆ render_sync()

◆ store_metadata()

void blender::eevee::Instance::store_metadata ( RenderResult * render_result)

Definition at line 611 of file eevee_instance.cc.

References cryptomatte, and blender::eevee::Cryptomatte::store_metadata().

Referenced by eevee_store_metadata().

◆ update_passes()

◆ use_lookdev_overlay()

bool blender::eevee::Instance::use_lookdev_overlay ( ) const
inline

◆ use_scene_lights()

bool blender::eevee::Instance::use_scene_lights ( ) const
inline

◆ use_studio_light()

bool blender::eevee::Instance::use_studio_light ( ) const
inline

◆ view_update()

void blender::eevee::Instance::view_update ( )

Definition at line 176 of file eevee_instance.cc.

Member Data Documentation

◆ ambient_occlusion

AmbientOcclusion blender::eevee::Instance::ambient_occlusion

Definition at line 94 of file eevee_instance.hh.

Referenced by begin_sync(), init(), and blender::eevee::ShadingView::render().

◆ camera

◆ camera_eval_object

Object* blender::eevee::Instance::camera_eval_object

Camera object if rendering through a camera. nullptr otherwise.

Definition at line 124 of file eevee_instance.hh.

Referenced by blender::eevee::Camera::init(), blender::eevee::DepthOfField::init(), blender::eevee::Camera::sync(), and blender::eevee::DepthOfField::sync().

◆ camera_orig_object

Object* blender::eevee::Instance::camera_orig_object

Definition at line 125 of file eevee_instance.hh.

Referenced by blender::eevee::Camera::init(), init(), and init_light_bake().

◆ capture_view

CaptureView blender::eevee::Instance::capture_view

Definition at line 107 of file eevee_instance.hh.

Referenced by light_bake_irradiance().

◆ cryptomatte

◆ debug_mode

◆ depsgraph

◆ depth_of_field

DepthOfField blender::eevee::Instance::depth_of_field

Definition at line 98 of file eevee_instance.hh.

Referenced by begin_sync(), init(), and init_light_bake().

◆ drw_view

const DRWView* blender::eevee::Instance::drw_view

Only available when rendering for viewport.

Definition at line 130 of file eevee_instance.hh.

Referenced by blender::eevee::Camera::init(), init(), init_light_bake(), and blender::eevee::Camera::sync().

◆ film

◆ gbuffer

◆ hiz_buffer

◆ is_light_bake

bool blender::eevee::Instance::is_light_bake = false

True if the instance is created for light baking.

Definition at line 135 of file eevee_instance.hh.

Referenced by begin_sync(), init_light_bake(), and is_baking().

◆ light_probes

◆ lights

◆ lookdev

LookdevModule blender::eevee::Instance::lookdev

◆ lookdev_view

LookdevView blender::eevee::Instance::lookdev_view

Definition at line 109 of file eevee_instance.hh.

◆ main_view

MainView blender::eevee::Instance::main_view

Definition at line 106 of file eevee_instance.hh.

Referenced by begin_sync(), init(), and init_light_bake().

◆ manager

Manager* blender::eevee::Instance::manager

Definition at line 119 of file eevee_instance.hh.

Referenced by blender::eevee::Film::accumulate(), blender::eevee::ShadowModule::begin_sync(), blender::eevee::BackgroundPipeline::clear(), blender::workbench::Instance::curves_sync(), blender::eevee::DeferredPipeline::debug_draw(), blender::eevee::HiZBuffer::debug_draw(), blender::eevee::LightModule::debug_draw(), blender::eevee::ShadowModule::debug_draw(), blender::eevee::LookdevModule::display(), blender::eevee::LookdevModule::draw(), blender::workbench::Instance::draw(), blender::eevee::VolumeModule::draw_compute(), blender::workbench::Instance::draw_image_render(), blender::eevee::VolumeModule::draw_resolve(), blender::workbench::Instance::draw_viewport(), blender::eevee::ShadowModule::end_sync(), blender::eevee::VelocityModule::geometry_steps_fill(), blender::workbench::Instance::hair_sync(), init(), init_light_bake(), light_bake_irradiance(), blender::eevee::VolumeLayer::material_add(), blender::eevee::ForwardPipeline::material_transparent_add(), object_sync(), blender::workbench::Instance::object_sync(), blender::eevee::VolumeLayer::occupancy_add(), blender::workbench::Instance::point_cloud_sync(), blender::eevee::ForwardPipeline::prepass_transparent_add(), blender::eevee::BackgroundPipeline::render(), blender::eevee::CapturePipeline::render(), blender::eevee::DeferredLayer::render(), blender::eevee::DeferredProbePipeline::render(), blender::eevee::DepthOfField::render(), blender::eevee::ForwardPipeline::render(), blender::eevee::MotionBlurModule::render(), blender::eevee::PlanarProbePipeline::render(), blender::eevee::RayTraceModule::render(), blender::eevee::ShadowPipeline::render(), blender::eevee::SubsurfaceModule::render(), blender::eevee::VolumeLayer::render(), blender::eevee::WorldPipeline::render(), blender::eevee::WorldVolumePipeline::render(), blender::eevee::AmbientOcclusion::render_pass(), render_sync(), blender::eevee::LightModule::set_view(), blender::eevee::ShadowModule::set_view(), blender::eevee::VelocityModule::step_sync(), blender::eevee::BackgroundPipeline::sync(), blender::eevee::LookdevModule::sync(), blender::eevee::World::sync(), blender::eevee::WorldPipeline::sync(), blender::eevee::WorldVolumePipeline::sync(), blender::eevee::SyncModule::sync_curves(), blender::eevee::SyncModule::sync_mesh(), blender::eevee::SyncModule::sync_point_cloud(), blender::eevee::SyncModule::sync_sculpt(), blender::eevee::SyncModule::sync_volume(), blender::eevee::HiZBuffer::update(), blender::eevee::PlanarProbeModule::viewport_draw(), and blender::eevee::Film::write_viewport_compositor_passes().

◆ materials

◆ motion_blur

MotionBlurModule blender::eevee::Instance::motion_blur

◆ pipelines

◆ planar_probes

◆ raytracing

RayTraceModule blender::eevee::Instance::raytracing

Definition at line 95 of file eevee_instance.hh.

Referenced by begin_sync(), init(), and blender::eevee::DeferredLayer::render().

◆ render

◆ render_buffers

◆ render_layer

const RenderLayer* blender::eevee::Instance::render_layer

Only available when rendering for final render.

Definition at line 127 of file eevee_instance.hh.

Referenced by init(), init_light_bake(), and render_frame().

◆ rv3d

const RegionView3D* blender::eevee::Instance::rv3d

◆ sampling

◆ scene

◆ shaders

◆ shadows

◆ sphere_probes

◆ subsurface

SubsurfaceModule blender::eevee::Instance::subsurface

Definition at line 90 of file eevee_instance.hh.

Referenced by end_sync(), and blender::eevee::DeferredLayer::render().

◆ sync

SyncModule blender::eevee::Instance::sync

◆ uniform_data

◆ use_curves

bool blender::eevee::Instance::use_curves = true

Definition at line 138 of file eevee_instance.hh.

Referenced by begin_sync(), and blender::eevee::SyncModule::sync_curves().

◆ use_surfaces

bool blender::eevee::Instance::use_surfaces = true

View-layer overrides.

Definition at line 137 of file eevee_instance.hh.

Referenced by begin_sync(), blender::eevee::SyncModule::sync_mesh(), and blender::eevee::SyncModule::sync_sculpt().

◆ use_volumes

bool blender::eevee::Instance::use_volumes = true

Definition at line 139 of file eevee_instance.hh.

Referenced by begin_sync(), and blender::eevee::SyncModule::sync_volume().

◆ v3d

◆ velocity

◆ view_layer

◆ volume

◆ volume_probes

◆ world


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