44void *Instance::debug_scope_render_sample =
nullptr;
45void *Instance::debug_scope_irradiance_setup =
nullptr;
46void *Instance::debug_scope_irradiance_sample =
nullptr;
77 rcti visible_rect = rect;
88 if (!is_default_border && use_border) {
114 visible_rect.
xmax = vp_size[0];
115 visible_rect.
ymax = vp_size[1];
116 visible_rect.
xmin = visible_rect.
ymin = 0;
127 const rcti *output_rect,
128 const rcti *visible_rect,
130 Depsgraph *depsgraph_,
147 update_eval_members();
267 update_eval_members();
276 rcti empty_rect{0, 0, 0, 0};
296void Instance::set_time(
float time)
300 update_eval_members();
303void Instance::update_eval_members()
374 const bool is_renderable_type =
ELEM(ob->
type,
388 if (!is_renderable_type || (!partsys_is_visible && !object_is_visible)) {
398 ob->object_to_world());
399 sync.
sync_curves(ob, hair_handle, ob_ref, _res_handle, &md, &particle_sys);
404 if (object_is_visible) {
518void Instance::render_sample()
542 DebugScope debug_scope(debug_scope_render_sample,
"EEVEE.render_sample");
562void Instance::render_read_result(
RenderLayer *render_layer,
const char *view_name)
568 if (pass_type == 0) {
573 for (
int64_t pass_offset : IndexRange(pass_names.
size())) {
575 render_layer, pass_names[pass_offset].c_str(), view_name);
617 for (
const std::string &vector_pass_name :
625 sizeof(
float) * 4 * vector_rp->
rectx * vector_rp->
recty);
642 if (!info_.empty()) {
650 this->render_sample();
673 if (
G.background ==
false && first_read) {
689 if (!info_.empty()) {
691 engine,
RPT_(
"Errors during render. See the System Console for more info."));
692 printf(
"%s", info_.c_str());
743 "Setting Preferences > System > Shader Compilation Method to Subprocess might improve "
744 "compilation time.");
762 this->render_sample();
796#define CHECK_PASS_LEGACY(name, type, channels, chanid) \
797 if (view_layer->passflag & (SCE_PASS_##name)) { \
798 RE_engine_register_pass( \
799 engine, scene, view_layer, RE_PASSNAME_##name, channels, chanid, type); \
802#define CHECK_PASS_EEVEE(name, type, channels, chanid) \
803 if (view_layer->eevee.render_passes & (EEVEE_RENDER_PASS_##name)) { \
804 RE_engine_register_pass( \
805 engine, scene, view_layer, RE_PASSNAME_##name, channels, chanid, type); \
888 custom_pipeline_wrapper([&]() {
907 DebugScope debug_scope(debug_scope_irradiance_setup,
"EEVEE.irradiance_setup");
933 context_wrapper([&]() {
934 DebugScope debug_scope(debug_scope_irradiance_sample,
"EEVEE.irradiance_sample");
963 result_update(cache_frame, progress);
General operations, lookup, etc. for blender objects.
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, float limit)
char * STRNCPY(char(&dst)[N], const char *src)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
Platform independent time functions.
#define SET_FLAG_FROM_TEST(value, test, flag)
uint64_t DEG_get_update_count(const Depsgraph *depsgraph)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
ID and Library types, which are fundamental for SDNA.
eViewLayerCryptomatteFlags
@ VIEW_LAYER_CRYPTOMATTE_MATERIAL
@ VIEW_LAYER_CRYPTOMATTE_ASSET
@ VIEW_LAYER_CRYPTOMATTE_OBJECT
#define EEVEE_RENDER_PASS_MAX_BIT
@ EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL
@ EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT
@ EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET
@ EEVEE_RENDER_PASS_VECTOR
#define RE_PASSNAME_COMBINED
@ SCE_EEVEE_SHADOW_JITTERED_VIEWPORT
void DRW_submission_end()
void DRW_render_context_disable(Render *render)
void DRW_submission_start()
void DRW_render_context_enable(Render *render)
const rcti * ED_region_visible_rect(ARegion *region)
void ED_view3d_calc_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, bool no_shift, rctf *r_viewborder)
bool GPU_use_subprocess_compilation()
void GPU_render_step(bool force_resource_release=false)
eGPUBackendType GPU_backend_get_type()
void GPU_framebuffer_viewport_reset(GPUFrameBuffer *fb)
void GPU_framebuffer_clear_color_depth(GPUFrameBuffer *fb, const float clear_col[4], float clear_depth)
void GPU_pass_cache_wait_for_all()
int GPU_texture_height(const GPUTexture *texture)
int GPU_texture_width(const GPUTexture *texture)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void begin_sync(Object *object_active=nullptr)
ResourceHandle resource_handle_for_psys(const ObjectRef &ref, const float4x4 &model_matrix)
static View & default_get()
void store_metadata(RenderResult *render_result)
static bool do_merge_direct_indirect_eval(const Instance &inst)
static bool do_split_direct_indirect_radiance(const Instance &inst)
eClosureBits closure_bits_get() const
int2 display_extent_get() const
static const Vector< std::string > pass_to_render_pass_names(eViewLayerEEVEEPassType pass_type, const ViewLayer *view_layer)
float * read_pass(eViewLayerEEVEEPassType pass_type, int layer_offset)
bool is_valid_render_extent() const
void write_viewport_compositor_passes()
const FilmData & get_data()
void init(const int2 &full_extent, const rcti *output_rect)
float * read_aov(ViewLayerAOV *aov)
eViewLayerEEVEEPassType enabled_passes_get() const
VolumeProbeModule volume_probes
void render_frame(RenderEngine *engine, RenderLayer *render_layer, const char *view_name)
void draw(Manager &manager) final
bool is_viewport_compositor_enabled
SphereProbeModule sphere_probes
ShaderGroups loaded_shaders
AmbientOcclusion ambient_occlusion
RayTraceModule raytracing
void info_append_i18n(const char *msg, Args &&...args)
SubsurfaceModule subsurface
Object * camera_eval_object
ShaderGroups needed_shaders
void light_bake_irradiance(Object &probe, FunctionRef< void()> context_enable, FunctionRef< void()> context_disable, FunctionRef< bool()> stop, FunctionRef< void(LightProbeGridCacheFrame *, float progress)> result_update)
bool needs_lightprobe_sphere_passes() const
bool needs_planar_probe_passes() const
void object_sync(ObjectRef &ob_ref, Manager &manager) final
RenderBuffers render_buffers
const RenderLayer * render_layer
const DRWContext * draw_ctx
bool is_viewport_image_render
const RegionView3D * rv3d
void store_metadata(RenderResult *render_result)
DepthOfField depth_of_field
PlanarProbeModule planar_probes
void draw_viewport_image_render()
static void update_passes(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
bool is_loaded(ShaderGroups groups) const
bool do_lightprobe_sphere_sync() const
UniformDataModule uniform_data
LightProbeModule light_probes
MotionBlurModule motion_blur
void init_light_bake(Depsgraph *depsgraph, draw::Manager *manager)
Object * camera_orig_object
bool do_planar_probe_sync() const
void init(const Object &probe_object)
void surfels_lights_eval()
void irradiance_capture()
LightProbeGridCacheFrame * read_result_packed()
LightProbeGridCacheFrame * read_result_unpacked()
void surfels_create(const Object &probe_object)
void sync_light(const Object *ob, ObjectHandle &handle)
void sync_probe(const Object *ob, ObjectHandle &handle)
void init(const rcti *visible_rect)
ShaderGroups default_materials_load_async()
int64_t queued_textures_count
ShaderGroups default_materials_wait_ready()
int64_t queued_optimize_shaders_count
int64_t queued_shaders_count
bool postfx_enabled() const
DeferredPipeline deferred
bool use_raytracing() const
RenderBuffersInfoData & data
uint64_t sample_index() const
bool finished_viewport() const
uint64_t sample_count() const
void init(const Scene *scene)
bool do_render_sync() const
ShaderGroups static_shaders_wait_ready(ShaderGroups request_bits)
bool request_specializations(bool block_until_ready, int render_buffers_shadow_id, int shadow_ray_count, int shadow_ray_step_count, bool use_split_indirect, bool use_lightprobe_eval)
ShaderGroups static_shaders_load_async(ShaderGroups request_bits)
const ShadowSceneData & get_data()
ObjectHandle & sync_object(const ObjectRef &ob_ref)
void sync_mesh(Object *ob, ObjectHandle &ob_handle, const ObjectRef &ob_ref)
void sync_curves(Object *ob, ObjectHandle &ob_handle, const ObjectRef &ob_ref, ResourceHandle res_handle=0, ModifierData *modifier_data=nullptr, ParticleSystem *particle_sys=nullptr)
void sync_volume(Object *ob, ObjectHandle &ob_handle, const ObjectRef &ob_ref)
bool sync_sculpt(Object *ob, ObjectHandle &ob_handle, const ObjectRef &ob_ref)
void sync_pointcloud(Object *ob, ObjectHandle &ob_handle, const ObjectRef &ob_ref)
void geometry_steps_fill()
bool camera_has_motion() const
const Depsgraph * depsgraph
DEGForeachIDComponentCallback callback
const DRWContext * DRW_context_get()
void DRW_custom_pipeline_begin(DRWContext &draw_ctx, Depsgraph *)
void DRW_render_object_iter(RenderEngine *engine, Depsgraph *depsgraph, std::function< void(blender::draw::ObjectRef &, RenderEngine *, Depsgraph *)> callback)
bool DRW_object_is_renderable(const Object *ob)
int DRW_object_visibility_in_active_context(const Object *ob)
void DRW_render_set_time(RenderEngine *engine, Depsgraph *depsgraph, int frame, float subframe)
void DRW_custom_pipeline_end(DRWContext &draw_ctx)
void DRW_viewport_request_redraw()
blender::draw::Manager * DRW_manager_get()
#define CHECK_PASS_EEVEE(name, type, channels, chanid)
#define CHECK_PASS_LEGACY(name, type, channels, chanid)
void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info)
void RE_engine_set_error_message(RenderEngine *engine, const char *msg)
void RE_engine_register_pass(RenderEngine *engine, Scene *scene, ViewLayer *view_layer, const char *name, int channels, const char *chanid, eNodeSocketDatatype type)
void RE_engine_update_progress(RenderEngine *engine, float progress)
MINLINE float fractf(float a)
@ DEFERRED_CAPTURE_SHADERS
@ DEFERRED_LIGHTING_SHADERS
@ IRRADIANCE_BAKE_SHADERS
@ DEFERRED_PLANAR_SHADERS
void foreach_hair_particle_handle(ObjectRef &ob_ref, ObjectHandle ob_handle, HairHandleCallback callback)
bool assign_if_different(T &old_value, T new_value)
VecBase< int32_t, 2 > int2
void RE_pass_set_buffer_data(RenderPass *pass, float *data)
RenderPass * RE_pass_find_by_name(RenderLayer *rl, const char *name, const char *viewname)
bool is_image_render() const
DefaultFramebufferList * viewport_framebuffer_list_get() const
blender::float2 viewport_size_get() const
bool is_viewport_image_render() const
bool is_transforming() const
DefaultTextureList * viewport_texture_list_get() const
bool is_navigating() const
bool is_viewport_compositor_enabled() const
GPUFrameBuffer * default_fb
ImBufFloatBuffer float_buffer
ThreadMutex update_render_passes_mutex