Blender V4.3
ED_view3d_offscreen.hh File Reference
#include "DNA_object_enums.h"
#include "DNA_view3d_types.h"
#include "IMB_imbuf_types.hh"

Go to the source code of this file.

Functions

void ED_view3d_draw_offscreen (Depsgraph *depsgraph, const Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int winx, int winy, const float viewmat[4][4], const float winmat[4][4], bool is_image_render, bool draw_background, const char *viewname, bool do_color_management, bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport)
 
void ED_view3d_draw_offscreen_simple (Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, int object_type_exclude_viewport_override, int object_type_exclude_select_override, int winx, int winy, unsigned int draw_flags, const float viewmat[4][4], const float winmat[4][4], float clip_start, float clip_end, bool is_xr_surface, bool is_image_render, bool draw_background, const char *viewname, bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport)
 
ImBufED_view3d_draw_offscreen_imbuf (Depsgraph *depsgraph, Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int sizex, int sizey, eImBufFlags imbuf_flag, int alpha_mode, const char *viewname, bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
 
ImBufED_view3d_draw_offscreen_imbuf_simple (Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, Object *camera, int width, int height, eImBufFlags imbuf_flags, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
 
bool ED_view3d_draw_offscreen_check_nested ()
 

Function Documentation

◆ ED_view3d_draw_offscreen()

void ED_view3d_draw_offscreen ( Depsgraph * depsgraph,
const Scene * scene,
eDrawType drawtype,
View3D * v3d,
ARegion * region,
int winx,
int winy,
const float viewmat[4][4],
const float winmat[4][4],
bool is_image_render,
bool draw_background,
const char * viewname,
bool do_color_management,
bool restore_rv3d_mats,
GPUOffScreen * ofs,
GPUViewport * viewport )

◆ ED_view3d_draw_offscreen_check_nested()

bool ED_view3d_draw_offscreen_check_nested ( )

Drawing off-screen is not supported while drawing, this is a simple check to use when the code path may occur within a draw call (Python scripting for example).

Definition at line 2158 of file view3d_draw.cc.

References DRW_draw_in_progress().

Referenced by pygpu_offscreen_draw_view3d().

◆ ED_view3d_draw_offscreen_imbuf()

ImBuf * ED_view3d_draw_offscreen_imbuf ( Depsgraph * depsgraph,
Scene * scene,
eDrawType drawtype,
View3D * v3d,
ARegion * region,
int sizex,
int sizey,
eImBufFlags imbuf_flag,
int alpha_mode,
const char * viewname,
bool restore_rv3d_mats,
GPUOffScreen * ofs,
GPUViewport * viewport,
char err_out[256] )

Utility func for ED_view3d_draw_offscreen

Parameters
ofsOptional off-screen buffer, can be NULL. (avoids re-creating when doing multiple GL renders).
viewportOptional viewport data, can be NULL. (avoids re-creating when doing multiple GL renders, allows keeping track of state across frames).

Definition at line 1881 of file view3d_draw.cc.

References BKE_camera_multiview_params(), BKE_camera_multiview_render(), BKE_camera_params_compute_matrix(), BKE_camera_params_compute_viewplane(), BKE_camera_params_from_object(), BKE_camera_params_init(), ImBuf::byte_buffer, View3D::camera, View3D::clip_end, View3D::clip_start, copy_m4_m4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, DEG_get_evaluated_object(), depsgraph, DRW_gpu_context_disable(), DRW_gpu_context_enable(), ED_view3d_draw_offscreen(), ED_view3d_viewplane_get(), ImBuf::float_buffer, GPU_DATA_FLOAT, GPU_DATA_UBYTE, GPU_framebuffer_active_get(), GPU_framebuffer_bind(), GPU_framebuffer_restore(), GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_format(), GPU_offscreen_free(), GPU_offscreen_height(), GPU_offscreen_read_color(), GPU_offscreen_unbind(), GPU_offscreen_width(), GPU_RGBA16F, GPU_RGBA8, GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, IB_rectfloat, IMB_allocImBuf(), IMB_rect_from_float(), orthographic_m4(), params, RegionView3D::persp, perspective_m4(), R_ADDSKY, RV3D_CAMOB, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by blend_file_thumb_from_camera(), ED_view3d_draw_offscreen_imbuf_simple(), screen_opengl_render_doit(), and texture_paint_image_from_view_exec().

◆ ED_view3d_draw_offscreen_imbuf_simple()

ImBuf * ED_view3d_draw_offscreen_imbuf_simple ( Depsgraph * depsgraph,
Scene * scene,
View3DShading * shading_override,
eDrawType drawtype,
Object * camera,
int width,
int height,
eImBufFlags imbuf_flags,
eV3DOffscreenDrawFlag draw_flags,
int alpha_mode,
const char * viewname,
GPUOffScreen * ofs,
GPUViewport * viewport,
char err_out[256] )

Creates separate fake 3d views (wrapping ED_view3d_draw_offscreen_imbuf)

Parameters
ofsOptional off-screen buffer can be NULL. (avoids re-creating when doing multiple GL renders).
viewportOptional viewport data, can be NULL. (avoids re-creating when doing multiple GL renders, allows keeping track of state across frames).
Note
used by the sequencer

Definition at line 2041 of file view3d_draw.cc.

References View3DShading::background_type, BKE_camera_multiview_params(), BKE_camera_multiview_render(), BKE_camera_params_compute_matrix(), BKE_camera_params_compute_viewplane(), BKE_camera_params_from_object(), BKE_camera_params_init(), BKE_scene_uses_blender_eevee(), BKE_scene_uses_blender_workbench(), camera, View3D::camera, View3D::clip_end, View3D::clip_start, View3DShading::color_type, copy_m4_m4(), DEG_get_evaluated_object(), depsgraph, ED_view3d_draw_offscreen_imbuf(), ListBase::first, View3DShading::flag, View3D::flag2, View3DOverlay::gpencil_vertex_paint_opacity, View3D::gridflag, invert_m4_m4(), ListBase::last, View3D::lens, View3DShading::light, mul_m4_m4m4(), normalize_m4(), OB_MATERIAL, OB_RENDER, OB_SOLID, OB_TEXTURE, View3D::overlay, params, RegionView3D::persinv, RegionView3D::persmat, RegionView3D::persp, View3D::regionbase, View3DShading::render_pass, RGN_TYPE_WINDOW, RV3D_CAMOB, SCE_PASS_COMBINED, View3D::shading, View3DShading::type, V3D_HIDE_OVERLAYS, V3D_LIGHTING_STUDIO, V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS, V3D_OFSDRAW_SHOW_ANNOTATION, V3D_OFSDRAW_SHOW_GRIDFLOOR, V3D_SHADING_BACKGROUND_WORLD, V3D_SHADING_SCENE_LIGHTS, V3D_SHADING_SCENE_LIGHTS_RENDER, V3D_SHADING_SCENE_WORLD, V3D_SHADING_SCENE_WORLD_RENDER, V3D_SHADING_TEXTURE_COLOR, V3D_SHOW_ANNOTATION, V3D_SHOW_FLOOR, V3D_SHOW_X, V3D_SHOW_Y, RegionView3D::viewinv, RegionView3D::viewmat, RegionView3D::winmat, View3DOverlay::wireframe_opacity, and View3DOverlay::wireframe_threshold.

Referenced by action_preview_render(), blend_file_thumb_from_camera(), ED_spacetype_sequencer(), object_preview_render(), and screen_opengl_render_doit().

◆ ED_view3d_draw_offscreen_simple()

void ED_view3d_draw_offscreen_simple ( Depsgraph * depsgraph,
Scene * scene,
View3DShading * shading_override,
eDrawType drawtype,
int object_type_exclude_viewport_override,
int object_type_exclude_select_override,
int winx,
int winy,
unsigned int draw_flags,
const float viewmat[4][4],
const float winmat[4][4],
float clip_start,
float clip_end,
bool is_xr_surface,
bool is_image_render,
bool draw_background,
const char * viewname,
bool do_color_management,
GPUOffScreen * ofs,
GPUViewport * viewport )

Creates separate fake 3d views (wrapping ED_view3d_draw_offscreen). Similar too #ED_view_draw_offscreen_imbuf_simple, but takes view/projection matrices as arguments.

Definition at line 1762 of file view3d_draw.cc.

References View3D::clip_end, View3D::clip_start, depsgraph, draw_background(), ED_view3d_draw_offscreen(), ListBase::first, View3D::flag, View3DOverlay::flag, View3DShading::flag, View3D::flag2, View3D::grid, View3D::gridflag, View3D::gridlines, View3D::gridsubdiv, ListBase::last, View3D::lens, OB_ARMATURE, OB_MATERIAL, View3D::object_type_exclude_select, View3D::object_type_exclude_viewport, View3D::overlay, RegionView3D::persp, View3D::regionbase, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_PERSP, View3D::shading, View3DShading::type, V3D_HIDE_HELPLINES, V3D_HIDE_OVERLAYS, V3D_OFSDRAW_NONE, V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS, V3D_OFSDRAW_SHOW_ANNOTATION, V3D_OFSDRAW_SHOW_GRIDFLOOR, V3D_OFSDRAW_SHOW_OBJECT_EXTRAS, V3D_OFSDRAW_SHOW_SELECTION, V3D_OFSDRAW_XR_SHOW_CONTROLLERS, V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS, V3D_OFSDRAW_XR_SHOW_PASSTHROUGH, V3D_OVERLAY_HIDE_BONES, V3D_OVERLAY_HIDE_CURSOR, V3D_OVERLAY_HIDE_MOTION_PATHS, V3D_OVERLAY_HIDE_OBJECT_ORIGINS, V3D_OVERLAY_HIDE_OBJECT_XTRAS, V3D_OVERLAY_HIDE_TEXT, V3D_SELECT_OUTLINE, V3D_SHADING_SCENE_LIGHTS, V3D_SHADING_SCENE_WORLD, V3D_SHOW_ANNOTATION, V3D_SHOW_FLOOR, V3D_SHOW_X, V3D_SHOW_Y, V3D_XR_SESSION_SURFACE, V3D_XR_SHOW_CONTROLLERS, V3D_XR_SHOW_CUSTOM_OVERLAYS, and V3D_XR_SHOW_PASSTHROUGH.

Referenced by wm_xr_draw_view().