Blender  V3.3
Classes | Macros | Functions
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.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_camera_types.h"
#include "DNA_action_types.h"
#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_anim_data.h"
#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_image_format.h"
#include "BKE_image_save.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_writeavi.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "DRW_engine.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_view3d_offscreen.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "RE_pipeline.h"
#include "BLT_translation.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "SEQ_render.h"
#include "GPU_framebuffer.h"
#include "GPU_matrix.h"
#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 char * screen_opengl_render_description (struct bContext *UNUSED(C), struct wmOperatorType *UNUSED(ot), struct PointerRNA *ptr)
 
void RENDER_OT_opengl (wmOperatorType *ot)
 

Macro Definition Documentation

◆ MAX_SCHEDULED_FRAMES

#define MAX_SCHEDULED_FRAMES   8

Definition at line 86 of file render_opengl.cc.

Function Documentation

◆ addAlphaOverFloat()

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

Definition at line 457 of file render_opengl.cc.

References dest, and 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 675 of file render_opengl.cc.

References bGPdata::adt, BKE_animdata_from_id(), BKE_library_foreach_ID_link(), BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, C, 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, scene, and OGLRender::scene.

Referenced by screen_opengl_render_init().

◆ gather_frames_to_render_for_adt()

static void gather_frames_to_render_for_adt ( const OGLRender oglrender,
const AnimData adt 
)
static

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

static int gather_frames_to_render_for_id ( LibraryIDLinkCallbackData cb_data)
static

◆ RENDER_OT_opengl()

void RENDER_OT_opengl ( wmOperatorType ot)

◆ schedule_write_result()

static bool schedule_write_result ( OGLRender oglrender,
RenderResult rr 
)
static

◆ screen_opengl_is_multiview()

static bool screen_opengl_is_multiview ( OGLRender oglrender)
static

◆ screen_opengl_render_anim_init()

static bool screen_opengl_render_anim_init ( bContext C,
wmOperator op 
)
static

◆ screen_opengl_render_anim_step()

static bool screen_opengl_render_anim_step ( bContext C,
wmOperator op 
)
static

◆ screen_opengl_render_apply()

static void screen_opengl_render_apply ( const bContext C,
OGLRender oglrender 
)
static

◆ screen_opengl_render_cancel()

static void screen_opengl_render_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 956 of file render_opengl.cc.

References C, wmOperator::customdata, and screen_opengl_render_end().

Referenced by RENDER_OT_opengl().

◆ screen_opengl_render_description()

static char* screen_opengl_render_description ( struct bContext UNUSEDC,
struct wmOperatorType UNUSEDot,
struct PointerRNA ptr 
)
static

Definition at line 1318 of file render_opengl.cc.

References BLI_strdup(), ptr, RNA_boolean_get(), and TIP_.

Referenced by RENDER_OT_opengl().

◆ screen_opengl_render_doit()

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

Definition at line 279 of file render_opengl.cc.

References RenderData::alphamode, BKE_camera_multiview_render(), BKE_image_stamp_buf(), blend_color_mix_byte(), BLI_assert, C, Scene::camera, View3D::camera, camera, RenderData::cfra, CTX_data_ensure_evaluated_depsgraph(), depsgraph, DRW_opengl_context_disable(), DRW_opengl_context_enable(), ED_annotation_draw_ex(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), SpaceSeq::flag, G, G_FLAG_RENDER_VIEWPORT, SpaceSeq::gpd, GPU_clear_color(), GPU_clear_depth(), GPU_DATA_UBYTE, GPU_matrix_reset(), GPU_matrix_translate_2f(), GPU_offscreen_bind(), GPU_offscreen_read_pixels(), GPU_offscreen_unbind(), IB_rect, IB_rectfloat, OGLRender::ibufs_arr, IMB_allocImBuf(), IMB_dupImBuf(), IMB_freeImBuf(), imb_freerectfloatImBuf(), IMB_rect_from_float(), OGLRender::is_sequencer, MEM_freeN, MEM_mallocN, OB_SOLID, OGLRender::ofs, usdtokens::out(), RegionView3D::persp, Scene::r, R_ADDSKY, R_ALPHAPREMUL, R_STAMP_ALL, R_STAMP_DRAW, OGLRender::re, RE_GetActiveRenderView(), RE_render_result_rect_from_ibuf(), RE_RenderViewGetById(), ImBuf::rect, RenderView::rect32, ImBuf::rect_float, RenderResult::rectx, RenderResult::recty, OGLRender::region, OGLRender::rv3d, RV3D_CAMOB, scene, OGLRender::scene, OGLRender::seq_data, SEQ_PREVIEW_SHOW_GPENCIL, View3D::shading, OGLRender::sizex, OGLRender::sizey, SPACE_SEQ, OGLRender::sseq, RenderData::stamp, View3DShading::type, OGLRender::v3d, V3D_OFSDRAW_SHOW_ANNOTATION, OGLRender::view_id, wmOrtho2(), ImBuf::x, RenderData::xsch, ImBuf::y, and RenderData::ysch.

Referenced by screen_opengl_render_apply().

◆ screen_opengl_render_end()

static void screen_opengl_render_end ( bContext C,
OGLRender oglrender 
)
static

◆ screen_opengl_render_exec()

static int screen_opengl_render_exec ( bContext C,
wmOperator op 
)
static

◆ screen_opengl_render_init()

static bool screen_opengl_render_init ( bContext C,
wmOperator op 
)
static

Definition at line 702 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(), OGLRender::bmain, C, Scene::camera, RenderData::cfra, 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_window(), CTX_wm_workspace(), wmOperator::customdata, Scene::customdata_mask, Scene::customdata_mask_modal, CustomData_MeshMasks_update(), OGLRender::depsgraph, ImageFormatData::depth, DRW_opengl_context_disable(), DRW_opengl_context_enable(), ED_view3d_context_activate(), ED_view3d_context_user_region(), ED_view3d_datamask(), G, gather_frames_to_render(), GPU_offscreen_create(), GPU_RGBA16F, OGLRender::ibufs_arr, RenderData::im_format, OGLRender::ima, IMA_SIGNAL_FREE, IMA_TYPE_R_RESULT, ImageFormatData::imtype, OGLRender::is_animation, OGLRender::is_sequencer, OGLRender::iuser, MEM_callocN, OGLRender::mh, OGLRender::movie_ctx_arr, OGLRender::num_scheduled_frames, OGLRender::ofs, PIL_check_seconds_timer(), OGLRender::pool_ok, OGLRender::prevar, OGLRender::prevsa, wmOperator::ptr, Scene::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, scene, OGLRender::scene, ImageUser::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, Scene::view_layers, 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()

static int screen_opengl_render_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ screen_opengl_render_modal()

static int screen_opengl_render_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ screen_opengl_render_write()

static void screen_opengl_render_write ( OGLRender oglrender)
static

◆ screen_opengl_views_setup()

static void screen_opengl_views_setup ( OGLRender oglrender)
static

◆ write_result()

static void write_result ( TaskPool *__restrict  pool,
WriteTaskData task_data 
)
static

◆ write_result_func()

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