|
Blender V4.3
|
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) |
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) |
A running instance of the engine.
Definition at line 68 of file eevee_instance.hh.
|
inline |
Definition at line 145 of file eevee_instance.hh.
References ambient_occlusion, camera, capture_view, blender::math::clamp(), cryptomatte, data, depth_of_field, film, hiz_buffer, light_probes, lights, lookdev, lookdev_view, main_view, materials, motion_blur, pipelines, planar_probes, raytracing, render_buffers, sampling, shaders, shadows, sphere_probes, subsurface, sync, uniform_data, velocity, volume, volume_probes, and world.
|
inline |
Definition at line 174 of file eevee_instance.hh.
| void blender::eevee::Instance::begin_sync | ( | ) |
Definition at line 191 of file eevee_instance.cc.
References ambient_occlusion, cryptomatte, depth_of_field, film, hiz_buffer, is_light_bake, is_viewport(), light_probes, lights, lookdev, main_view, materials, motion_blur, pipelines, raytracing, sampling, SCE_LAY_SOLID, SCE_LAY_STRAND, SCE_LAY_VOLUMES, shadows, sphere_probes, use_curves, use_surfaces, use_volumes, velocity, view_layer, volume, volume_probes, and world.
Referenced by blender::eevee::DeferredPipeline::begin_sync(), and render_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().
| 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().
| void blender::eevee::Instance::draw_viewport | ( | ) |
Definition at line 558 of file eevee_instance.cc.
References DefaultFramebufferList::default_fb, DRW_state_is_playback(), DRW_viewport_framebuffer_list_get(), DRW_viewport_request_redraw(), film, GPU_BACKEND_OPENGL, GPU_DEVICE_ANY, GPU_DRIVER_ANY, GPU_framebuffer_clear_color_depth(), GPU_OS_ANY, GPU_type_matches_ex(), GPU_use_parallel_compilation(), info_append_i18n(), materials, sampling, and velocity.
Referenced by eevee_draw_scene().
| 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().
| void blender::eevee::Instance::end_sync | ( | ) |
Definition at line 316 of file eevee_instance.cc.
References cryptomatte, DEG_get_update_count(), depsgraph, film, light_probes, lights, pipelines, planar_probes, sampling, shadows, sphere_probes, subsurface, uniform_data, velocity, and volume.
Referenced by render_sync().
Definition at line 351 of file eevee_instance.hh.
References ID_RECALC_SHADING, int, and world.
Definition at line 330 of file eevee_instance.hh.
References blender::draw::ObjectRef::dupli_parent, ID_RECALC_GEOMETRY, ID_RECALC_SHADING, ID_RECALC_TRANSFORM, blender::draw::ObjectRef::object, Object::runtime, and SET_FLAG_FROM_TEST.
|
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.
|
inline |
Definition at line 232 of file eevee_instance.hh.
Referenced by blender::eevee::DeferredPipeline::debug_draw().
|
inline |
Definition at line 240 of file eevee_instance.hh.
References BLI_str_endswith(), and RPT_.
Referenced by draw_viewport().
|
inline |
Definition at line 249 of file eevee_instance.hh.
Referenced by eevee_draw_scene().
| 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 ) |
Definition at line 47 of file eevee_instance.cc.
References ambient_occlusion, blender::assign_if_different(), BLI_rcti_size_x(), BLI_rcti_size_y(), camera, camera_orig_object, debug_mode, depsgraph, depth_of_field, DRW_manager_get(), drw_view, film, G, is_image_render(), is_navigating(), is_painting(), light_probes, lookdev, main_view, manager, motion_blur, planar_probes, raytracing, render, render_buffers, render_layer, rv3d, sampling, SCE_EEVEE_SHADOW_JITTERED_VIEWPORT, scene, shaders, shadows, sphere_probes, v3d, V3D_HIDE_OVERLAYS, velocity, volume, volume_probes, rcti::xmin, and rcti::ymin.
Referenced by eevee_engine_init().
| void blender::eevee::Instance::init_light_bake | ( | Depsgraph * | depsgraph, |
| draw::Manager * | manager ) |
Definition at line 123 of file eevee_instance.cc.
References camera, camera_orig_object, debug_mode, depsgraph, depth_of_field, drw_view, film, G, is_light_bake, light_probes, lookdev, main_view, manager, planar_probes, render, render_buffers, render_layer, rv3d, sampling, scene, shaders, shadows, sphere_probes, v3d, velocity, volume, and volume_probes.
|
inline |
Definition at line 269 of file eevee_instance.hh.
References is_light_bake.
Referenced by is_viewport(), and light_bake_irradiance().
|
inline |
Definition at line 259 of file eevee_instance.hh.
References DRW_state_is_image_render().
Referenced by init(), and is_transforming().
|
inline |
Definition at line 296 of file eevee_instance.hh.
References DRW_state_is_navigating().
Referenced by init().
|
inline |
Definition at line 301 of file eevee_instance.hh.
References DRW_state_is_painting().
Referenced by init().
|
inline |
Definition at line 285 of file eevee_instance.hh.
References DRW_state_is_playback().
|
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().
|
inline |
Definition at line 254 of file eevee_instance.hh.
References is_baking(), and render.
Referenced by begin_sync().
|
inline |
Definition at line 264 of file eevee_instance.hh.
References DRW_state_is_viewport_image_render().
| 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 ) |
Definition at line 684 of file eevee_instance.cc.
References BLI_assert, capture_view, depsgraph, draw_engine_eevee_next_type, DRW_custom_pipeline_begin(), DRW_custom_pipeline_end(), float, is_baking(), manager, render_sync(), sampling, and volume_probes.
| 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().
| 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().
| void blender::eevee::Instance::object_sync | ( | Object * | ob | ) |
Definition at line 235 of file eevee_instance.cc.
References DRW_context_state_get(), DRW_object_is_renderable(), DRW_object_ref_get(), DRW_object_visibility_in_active_context(), ELEM, blender::eevee::foreach_hair_particle_handle(), light_probes, lights, manager, OB_CURVES, OB_GREASE_PENCIL, OB_LAMP, OB_LIGHTPROBE, OB_MESH, OB_POINTCLOUD, OB_VISIBLE_PARTICLES, OB_VISIBLE_SELF, OB_VOLUME, sync, and Object::type.
|
inline |
Definition at line 274 of file eevee_instance.hh.
| void blender::eevee::Instance::render_frame | ( | RenderEngine * | engine, |
| RenderLayer * | render_layer, | ||
| const char * | view_name ) |
WORKAROUND: Re-sync to check if all shaders are already compiled.
Definition at line 499 of file eevee_instance.cc.
References BLI_time_sleep_ms(), DRW_render_context_disable(), DRW_render_context_enable(), film, G, GPU_backend_get_type(), GPU_BACKEND_METAL, GPU_flush(), GPU_render_step(), materials, printf, RE_engine_set_error_message(), RE_engine_update_progress(), RE_engine_update_stats(), render, render_layer, render_sync(), RPT_, and sampling.
| void blender::eevee::Instance::render_sync | ( | ) |
Definition at line 340 of file eevee_instance.cc.
References begin_sync(), blender::draw::curves_free(), blender::draw::curves_init(), blender::draw::curves_update(), depsgraph, DRW_cache_restart(), blender::draw::DRW_curves_update(), DRW_render_instance_buffer_finish(), DRW_render_object_iter(), end_sync(), blender::draw::hair_free(), blender::draw::hair_init(), blender::draw::hair_update(), manager, render, and velocity.
Referenced by light_bake_irradiance(), and render_frame().
| void blender::eevee::Instance::store_metadata | ( | RenderResult * | render_result | ) |
Definition at line 611 of file eevee_instance.cc.
References cryptomatte.
|
static |
Definition at line 616 of file eevee_instance.cc.
References AOV_CONFLICT, AOV_TYPE_COLOR, AOV_TYPE_VALUE, CHECK_PASS_EEVEE, CHECK_PASS_LEGACY, EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL, EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, LISTBASE_FOREACH, NORMAL, blender::eevee::Film::pass_to_render_pass_names(), RE_engine_register_pass(), RE_PASSNAME_COMBINED, scene, SOCK_FLOAT, SOCK_RGBA, SOCK_VECTOR, view_layer, VIEW_LAYER_CRYPTOMATTE_ASSET, VIEW_LAYER_CRYPTOMATTE_MATERIAL, VIEW_LAYER_CRYPTOMATTE_OBJECT, and Z.
|
inline |
Definition at line 324 of file eevee_instance.hh.
References OB_MATERIAL, v3d, and V3D_OVERLAY_LOOK_DEV.
|
inline |
Definition at line 306 of file eevee_instance.hh.
References OB_MATERIAL, OB_RENDER, v3d, V3D_SHADING_SCENE_LIGHTS, and V3D_SHADING_SCENE_LIGHTS_RENDER.
|
inline |
Definition at line 316 of file eevee_instance.hh.
References OB_MATERIAL, OB_RENDER, v3d, V3D_SHADING_SCENE_WORLD, and V3D_SHADING_SCENE_WORLD_RENDER.
| void blender::eevee::Instance::view_update | ( | ) |
Definition at line 176 of file eevee_instance.cc.
References sampling.
| AmbientOcclusion blender::eevee::Instance::ambient_occlusion |
Definition at line 94 of file eevee_instance.hh.
Referenced by begin_sync(), init(), and Instance().
| Camera blender::eevee::Instance::camera |
Definition at line 103 of file eevee_instance.hh.
Referenced by init(), init_light_bake(), and Instance().
| 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.
| Object* blender::eevee::Instance::camera_orig_object |
Definition at line 125 of file eevee_instance.hh.
Referenced by init(), and init_light_bake().
| CaptureView blender::eevee::Instance::capture_view |
Definition at line 107 of file eevee_instance.hh.
Referenced by Instance(), and light_bake_irradiance().
| Cryptomatte blender::eevee::Instance::cryptomatte |
Definition at line 99 of file eevee_instance.hh.
Referenced by begin_sync(), end_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), Instance(), and store_metadata().
| 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* blender::eevee::Instance::depsgraph |
Input data.
Definition at line 118 of file eevee_instance.hh.
Referenced by end_sync(), gpencil_engine_enabled(), init(), init_light_bake(), light_bake_irradiance(), and render_sync().
| 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().
| 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 blender::eevee::Instance::film |
Definition at line 104 of file eevee_instance.hh.
Referenced by begin_sync(), draw_viewport(), draw_viewport_image_render(), end_sync(), init(), init_light_bake(), Instance(), and render_frame().
| GBuffer blender::eevee::Instance::gbuffer |
Definition at line 100 of file eevee_instance.hh.
Referenced by blender::eevee::DeferredLayerBase::gbuffer_pass_sync().
| HiZBuffer blender::eevee::Instance::hiz_buffer |
Definition at line 101 of file eevee_instance.hh.
Referenced by begin_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), and Instance().
| 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().
| 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().
| LightModule blender::eevee::Instance::lights |
Definition at line 93 of file eevee_instance.hh.
Referenced by begin_sync(), end_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), Instance(), and object_sync().
| LookdevModule blender::eevee::Instance::lookdev |
Definition at line 110 of file eevee_instance.hh.
Referenced by begin_sync(), init(), init_light_bake(), and Instance().
| LookdevView blender::eevee::Instance::lookdev_view |
Definition at line 109 of file eevee_instance.hh.
Referenced by Instance().
| 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* blender::eevee::Instance::manager |
Definition at line 119 of file eevee_instance.hh.
Referenced by blender::workbench::Instance::curves_sync(), blender::eevee::DeferredPipeline::debug_draw(), blender::workbench::Instance::draw(), blender::workbench::Instance::draw_image_render(), blender::workbench::Instance::draw_viewport(), blender::workbench::Instance::hair_sync(), init(), init_light_bake(), light_bake_irradiance(), object_sync(), blender::workbench::Instance::object_sync(), blender::workbench::Instance::point_cloud_sync(), and render_sync().
| MaterialModule blender::eevee::Instance::materials |
Definition at line 89 of file eevee_instance.hh.
Referenced by begin_sync(), do_lightprobe_sphere_sync(), do_planar_probe_sync(), draw_viewport(), Instance(), and render_frame().
| MotionBlurModule blender::eevee::Instance::motion_blur |
Definition at line 97 of file eevee_instance.hh.
Referenced by begin_sync(), init(), and Instance().
| PipelineModule blender::eevee::Instance::pipelines |
Definition at line 91 of file eevee_instance.hh.
Referenced by begin_sync(), end_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), and Instance().
| PlanarProbeModule blender::eevee::Instance::planar_probes |
Definition at line 112 of file eevee_instance.hh.
Referenced by end_sync(), init(), init_light_bake(), Instance(), and needs_planar_probe_passes().
| RayTraceModule blender::eevee::Instance::raytracing |
Definition at line 95 of file eevee_instance.hh.
Referenced by begin_sync(), init(), and Instance().
| 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().
| RenderBuffers blender::eevee::Instance::render_buffers |
Definition at line 105 of file eevee_instance.hh.
Referenced by blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), init(), init_light_bake(), and Instance().
| 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().
| const RegionView3D* blender::eevee::Instance::rv3d |
Definition at line 132 of file eevee_instance.hh.
Referenced by init(), and init_light_bake().
| Sampling blender::eevee::Instance::sampling |
Definition at line 102 of file eevee_instance.hh.
Referenced by begin_sync(), draw_viewport(), draw_viewport_image_render(), end_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), init(), init_light_bake(), Instance(), light_bake_irradiance(), render_frame(), and view_update().
| 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().
| ShaderModule& blender::eevee::Instance::shaders |
Definition at line 86 of file eevee_instance.hh.
Referenced by init(), init_light_bake(), and Instance().
| ShadowModule blender::eevee::Instance::shadows |
Definition at line 92 of file eevee_instance.hh.
Referenced by begin_sync(), end_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), init(), init_light_bake(), and Instance().
| SphereProbeModule blender::eevee::Instance::sphere_probes |
Definition at line 111 of file eevee_instance.hh.
Referenced by begin_sync(), end_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), init(), init_light_bake(), Instance(), and needs_lightprobe_sphere_passes().
| SubsurfaceModule blender::eevee::Instance::subsurface |
Definition at line 90 of file eevee_instance.hh.
Referenced by end_sync(), and Instance().
| SyncModule blender::eevee::Instance::sync |
Definition at line 87 of file eevee_instance.hh.
Referenced by Instance(), object_sync(), and blender::eevee::step_object_sync_render().
| UniformDataModule blender::eevee::Instance::uniform_data |
Definition at line 88 of file eevee_instance.hh.
Referenced by end_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), and Instance().
| bool blender::eevee::Instance::use_curves = true |
Definition at line 138 of file eevee_instance.hh.
Referenced by begin_sync().
| bool blender::eevee::Instance::use_surfaces = true |
| bool blender::eevee::Instance::use_volumes = true |
Definition at line 139 of file eevee_instance.hh.
Referenced by begin_sync().
| const View3D* blender::eevee::Instance::v3d |
Definition at line 131 of file eevee_instance.hh.
Referenced by init(), init_light_bake(), use_lookdev_overlay(), use_scene_lights(), and use_studio_light().
| VelocityModule blender::eevee::Instance::velocity |
Definition at line 96 of file eevee_instance.hh.
Referenced by begin_sync(), draw_viewport(), draw_viewport_image_render(), end_sync(), init(), init_light_bake(), Instance(), render_sync(), and blender::eevee::step_object_sync_render().
| ViewLayer* blender::eevee::Instance::view_layer |
Definition at line 122 of file eevee_instance.hh.
Referenced by begin_sync(), and update_passes().
| 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().
| VolumeProbeModule blender::eevee::Instance::volume_probes |
Definition at line 113 of file eevee_instance.hh.
Referenced by begin_sync(), blender::eevee::DeferredLayerBase::gbuffer_pass_sync(), init(), init_light_bake(), Instance(), and light_bake_irradiance().
| World blender::eevee::Instance::world |
Definition at line 108 of file eevee_instance.hh.
Referenced by begin_sync(), get_recalc_flags(), and Instance().