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()

◆ ~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 materials, and needs_lightprobe_sphere_passes().

◆ do_planar_probe_sync()

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

Definition at line 386 of file eevee_instance.cc.

References materials, and 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 film, sampling, and velocity.

Referenced by eevee_draw_scene().

◆ end_sync()

void blender::eevee::Instance::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, int, and world.

◆ get_recalc_flags() [2/2]

int blender::eevee::Instance::get_recalc_flags ( const ObjectRef & ob_ref)
inline

◆ 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.

◆ info_append()

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

Definition at line 232 of file eevee_instance.hh.

Referenced by blender::eevee::DeferredPipeline::debug_draw().

◆ info_append_i18n()

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

Definition at line 240 of file eevee_instance.hh.

References BLI_str_endswith(), and RPT_.

Referenced by draw_viewport().

◆ info_get()

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

Definition at line 249 of file eevee_instance.hh.

Referenced by eevee_draw_scene().

◆ 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()

void blender::eevee::Instance::init_light_bake ( Depsgraph * depsgraph,
draw::Manager * manager )

◆ is_baking()

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

Definition at line 269 of file eevee_instance.hh.

References is_light_bake.

Referenced by is_viewport(), and light_bake_irradiance().

◆ is_image_render()

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

Definition at line 259 of file eevee_instance.hh.

References DRW_state_is_image_render().

Referenced by init(), and is_transforming().

◆ is_navigating()

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

Definition at line 296 of file eevee_instance.hh.

References DRW_state_is_navigating().

Referenced by init().

◆ 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()

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

Definition at line 285 of file eevee_instance.hh.

References DRW_state_is_playback().

◆ is_transforming()

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

Definition at line 290 of file eevee_instance.hh.

References BLI_assert_msg, G, G_TRANSFORM_EDIT, G_TRANSFORM_OBJ, and is_image_render().

◆ is_viewport()

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

Definition at line 254 of file eevee_instance.hh.

References is_baking(), and render.

Referenced by begin_sync().

◆ is_viewport_image_render()

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

Definition at line 264 of file eevee_instance.hh.

References DRW_state_is_viewport_image_render().

◆ light_bake_irradiance()

void blender::eevee::Instance::light_bake_irradiance ( Object & probe,
FunctionRef< void()> context_enable,
FunctionRef< void()> context_disable,
FunctionRef< bool()> stop,
FunctionRef< void(LightProbeGridCacheFrame *, float progress)> result_update )

◆ 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

Definition at line 274 of file eevee_instance.hh.

◆ 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.

◆ update_passes()

◆ use_lookdev_overlay()

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

Definition at line 324 of file eevee_instance.hh.

References OB_MATERIAL, v3d, and V3D_OVERLAY_LOOK_DEV.

◆ 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.

References sampling.

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 Instance().

◆ camera

Camera blender::eevee::Instance::camera

Definition at line 103 of file eevee_instance.hh.

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

◆ 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.

◆ camera_orig_object

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

Definition at line 125 of file eevee_instance.hh.

Referenced by init(), and init_light_bake().

◆ capture_view

CaptureView blender::eevee::Instance::capture_view

Definition at line 107 of file eevee_instance.hh.

Referenced by Instance(), and light_bake_irradiance().

◆ cryptomatte

Cryptomatte blender::eevee::Instance::cryptomatte

◆ debug_mode

eDebugMode blender::eevee::Instance::debug_mode = eDebugMode::DEBUG_NONE

Debug mode from debug value.

Definition at line 142 of file eevee_instance.hh.

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

◆ depsgraph

Depsgraph* blender::eevee::Instance::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(), init_light_bake(), and Instance().

◆ 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 init(), and init_light_bake().

◆ film

Film blender::eevee::Instance::film

◆ gbuffer

GBuffer blender::eevee::Instance::gbuffer

◆ hiz_buffer

HiZBuffer blender::eevee::Instance::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

LightProbeModule blender::eevee::Instance::light_probes

Definition at line 114 of file eevee_instance.hh.

Referenced by begin_sync(), end_sync(), init(), init_light_bake(), Instance(), and object_sync().

◆ lights

LightModule blender::eevee::Instance::lights

◆ lookdev

LookdevModule blender::eevee::Instance::lookdev

Definition at line 110 of file eevee_instance.hh.

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

◆ lookdev_view

LookdevView blender::eevee::Instance::lookdev_view

Definition at line 109 of file eevee_instance.hh.

Referenced by Instance().

◆ main_view

MainView blender::eevee::Instance::main_view

Definition at line 106 of file eevee_instance.hh.

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

◆ manager

◆ materials

MaterialModule blender::eevee::Instance::materials

◆ motion_blur

MotionBlurModule blender::eevee::Instance::motion_blur

Definition at line 97 of file eevee_instance.hh.

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

◆ pipelines

PipelineModule blender::eevee::Instance::pipelines

◆ planar_probes

PlanarProbeModule blender::eevee::Instance::planar_probes

◆ raytracing

RayTraceModule blender::eevee::Instance::raytracing

Definition at line 95 of file eevee_instance.hh.

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

◆ render

RenderEngine* blender::eevee::Instance::render

Definition at line 128 of file eevee_instance.hh.

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

◆ render_buffers

RenderBuffers blender::eevee::Instance::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

Definition at line 132 of file eevee_instance.hh.

Referenced by init(), and init_light_bake().

◆ sampling

◆ scene

Scene* blender::eevee::Instance::scene

Evaluated IDs.

Definition at line 121 of file eevee_instance.hh.

Referenced by blender::eevee::DeferredPipeline::begin_sync(), init(), init_light_bake(), and update_passes().

◆ shaders

ShaderModule& blender::eevee::Instance::shaders

Definition at line 86 of file eevee_instance.hh.

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

◆ shadows

ShadowModule blender::eevee::Instance::shadows

◆ sphere_probes

◆ subsurface

SubsurfaceModule blender::eevee::Instance::subsurface

Definition at line 90 of file eevee_instance.hh.

Referenced by end_sync(), and Instance().

◆ sync

SyncModule blender::eevee::Instance::sync

◆ uniform_data

UniformDataModule blender::eevee::Instance::uniform_data

◆ use_curves

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

Definition at line 138 of file eevee_instance.hh.

Referenced by begin_sync().

◆ 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().

◆ use_volumes

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

Definition at line 139 of file eevee_instance.hh.

Referenced by begin_sync().

◆ v3d

const View3D* blender::eevee::Instance::v3d

◆ velocity

◆ view_layer

ViewLayer* blender::eevee::Instance::view_layer

Definition at line 122 of file eevee_instance.hh.

Referenced by begin_sync(), and update_passes().

◆ volume

VolumeModule blender::eevee::Instance::volume

Definition at line 115 of file eevee_instance.hh.

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

◆ volume_probes

◆ world

World blender::eevee::Instance::world

Definition at line 108 of file eevee_instance.hh.

Referenced by begin_sync(), get_recalc_flags(), and Instance().


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