Blender V4.3
render_opengl.cc File Reference
#include <cmath>
#include <cstddef>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_bitmap.h"
#include "BLI_blenlib.h"
#include "BLI_math_color_blend.h"
#include "BLI_task.h"
#include "BLI_task.hh"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "DNA_action_types.h"
#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_anim_data.hh"
#include "BKE_camera.h"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_image.hh"
#include "BKE_image_format.hh"
#include "BKE_image_save.hh"
#include "BKE_lib_query.hh"
#include "BKE_main.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_writemovie.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "DRW_engine.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_gpencil_legacy.hh"
#include "ED_screen.hh"
#include "ED_view3d.hh"
#include "ED_view3d_offscreen.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "RE_pipeline.h"
#include "BLT_translation.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "SEQ_render.hh"
#include "ANIM_action_legacy.hh"
#include "GPU_framebuffer.hh"
#include "GPU_matrix.hh"
#include "GPU_viewport.hh"
#include "render_intern.hh"

Go to the source code of this file.

Classes

struct  OGLRender
 
struct  WriteTaskData
 

Macros

#define MAX_SCHEDULED_FRAMES   8
 

Functions

static bool screen_opengl_is_multiview (OGLRender *oglrender)
 
static void screen_opengl_views_setup (OGLRender *oglrender)
 
static void screen_opengl_render_doit (const bContext *C, OGLRender *oglrender, RenderResult *rr)
 
static void screen_opengl_render_write (OGLRender *oglrender)
 
static void UNUSED_FUNCTION addAlphaOverFloat (float dest[4], const float source[4])
 
static void screen_opengl_render_apply (const bContext *C, OGLRender *oglrender)
 
static void gather_frames_to_render_for_adt (const OGLRender *oglrender, const AnimData *adt)
 
static void gather_frames_to_render_for_grease_pencil (const OGLRender *oglrender, const bGPdata *gp)
 
static int gather_frames_to_render_for_id (LibraryIDLinkCallbackData *cb_data)
 
static void gather_frames_to_render (bContext *C, OGLRender *oglrender)
 
static bool screen_opengl_render_init (bContext *C, wmOperator *op)
 
static void screen_opengl_render_end (bContext *C, OGLRender *oglrender)
 
static void screen_opengl_render_cancel (bContext *C, wmOperator *op)
 
static bool screen_opengl_render_anim_init (bContext *C, wmOperator *op)
 
static void write_result (TaskPool *__restrict pool, WriteTaskData *task_data)
 
static void write_result_func (TaskPool *__restrict pool, void *task_data_v)
 
static bool schedule_write_result (OGLRender *oglrender, RenderResult *rr)
 
static bool screen_opengl_render_anim_step (bContext *C, wmOperator *op)
 
static int screen_opengl_render_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int screen_opengl_render_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int screen_opengl_render_exec (bContext *C, wmOperator *op)
 
static std::string screen_opengl_render_get_description (bContext *, wmOperatorType *, PointerRNA *ptr)
 
void RENDER_OT_opengl (wmOperatorType *ot)
 

Macro Definition Documentation

◆ MAX_SCHEDULED_FRAMES

#define MAX_SCHEDULED_FRAMES   8

Definition at line 87 of file render_opengl.cc.

Referenced by schedule_write_result().

Function Documentation

◆ addAlphaOverFloat()

static void UNUSED_FUNCTION addAlphaOverFloat ( float dest[4],
const float source[4] )
static

Definition at line 437 of file render_opengl.cc.

References mul().

◆ gather_frames_to_render()

static void gather_frames_to_render ( bContext * C,
OGLRender * oglrender )
static

Collect the frame numbers for which selected objects have keys in the animation data. The frames ares stored in OGLRender.render_frames.

Note that this follows all pointers to ID blocks, only filtering on ID type, so it will pick up keys from pointers in custom properties as well.

Definition at line 658 of file render_opengl.cc.

References BKE_animdata_from_id(), BKE_library_foreach_ID_link(), BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, CTX_DATA_BEGIN, CTX_DATA_END, gather_frames_to_render_for_adt(), gather_frames_to_render_for_id(), IDWALK_RECURSE, PEFRA, PSFRA, OGLRender::render_frames, and OGLRender::scene.

Referenced by screen_opengl_render_init().

◆ gather_frames_to_render_for_adt()

◆ gather_frames_to_render_for_grease_pencil()

static void gather_frames_to_render_for_grease_pencil ( const OGLRender * oglrender,
const bGPdata * gp )
static

◆ gather_frames_to_render_for_id()

◆ RENDER_OT_opengl()

◆ schedule_write_result()

◆ screen_opengl_is_multiview()

static bool screen_opengl_is_multiview ( OGLRender * oglrender)
static

◆ screen_opengl_render_anim_init()

◆ screen_opengl_render_anim_step()

◆ screen_opengl_render_apply()

◆ screen_opengl_render_cancel()

static void screen_opengl_render_cancel ( bContext * C,
wmOperator * op )
static

Definition at line 953 of file render_opengl.cc.

References wmOperator::customdata, and screen_opengl_render_end().

Referenced by RENDER_OT_opengl().

◆ screen_opengl_render_doit()

static void screen_opengl_render_doit ( const bContext * C,
OGLRender * oglrender,
RenderResult * rr )
static

◆ screen_opengl_render_end()

◆ screen_opengl_render_exec()

◆ screen_opengl_render_get_description()

static std::string screen_opengl_render_get_description ( bContext * ,
wmOperatorType * ,
PointerRNA * ptr )
static

Definition at line 1322 of file render_opengl.cc.

References ptr, RNA_boolean_get(), and TIP_.

Referenced by RENDER_OT_opengl().

◆ screen_opengl_render_init()

static bool screen_opengl_render_init ( bContext * C,
wmOperator * op )
static

Definition at line 685 of file render_opengl.cc.

References BKE_image_backup_render(), BKE_image_ensure_viewer(), BKE_image_signal(), BKE_imtype_is_movie(), BKE_render_resolution(), BKE_report(), BKE_reportf(), BKE_scene_multiview_num_views_get(), BLI_condition_init(), BLI_mutex_init(), BLI_spin_init(), BLI_task_pool_create(), BLI_task_pool_create_background_serial(), BLI_time_now_seconds(), OGLRender::bmain, OGLRender::cfrao, OGLRender::color_depth, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_screen(), CTX_wm_space_seq(), CTX_wm_view3d(), CTX_wm_window(), CTX_wm_workspace(), wmOperator::customdata, Scene::customdata_mask, Scene::customdata_mask_modal, CustomData_MeshMasks_update(), OGLRender::depsgraph, DRW_gpu_context_disable(), DRW_gpu_context_enable(), ED_view3d_context_activate(), ED_view3d_context_user_region(), ED_view3d_datamask(), G, gather_frames_to_render(), GPU_offscreen_create(), GPU_RGBA16F, GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, GPU_viewport_create(), OGLRender::ibufs_arr, OGLRender::ima, IMA_SIGNAL_FREE, IMA_TYPE_R_RESULT, OGLRender::is_animation, OGLRender::is_sequencer, OGLRender::iuser, MEM_callocN, OGLRender::mh, OGLRender::movie_ctx_arr, OGLRender::num_scheduled_frames, OGLRender::ofs, OGLRender::pool_ok, OGLRender::prevar, OGLRender::prevsa, wmOperator::ptr, Render::r, R_IMF_CHAN_DEPTH_32, OGLRender::re, RE_InitState(), RE_NewSceneRender(), OGLRender::region, ARegion::regiondata, wmOperator::reports, OGLRender::reports_lock, RNA_boolean_get(), RNA_boolean_set(), RPT_ERROR, OGLRender::rv3d, ImageUser::scene, OGLRender::scene, scene, screen_opengl_views_setup(), OGLRender::seq_data, OGLRender::sizex, OGLRender::sizey, OGLRender::sseq, OGLRender::task_condition, OGLRender::task_mutex, OGLRender::task_pool, TASK_PRIORITY_HIGH, OGLRender::totvideos, OGLRender::v3d, OGLRender::view_layer, OGLRender::viewport, OGLRender::views_len, OGLRender::win, OGLRender::wm, WM_JOB_TYPE_RENDER, WM_jobs_kill_all_except(), WM_jobs_test(), OGLRender::workspace, and OGLRender::write_still.

Referenced by screen_opengl_render_exec(), and screen_opengl_render_invoke().

◆ screen_opengl_render_invoke()

◆ screen_opengl_render_modal()

◆ screen_opengl_render_write()

◆ screen_opengl_views_setup()

◆ write_result()

◆ write_result_func()

static void write_result_func ( TaskPool *__restrict pool,
void * task_data_v )
static

Definition at line 1100 of file render_opengl.cc.

References blender::threading::isolate_task(), and write_result().

Referenced by schedule_write_result().