Blender V2.61 - r43446
Functions | Variables

pipeline.c File Reference

#include <math.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include "DNA_group_types.h"
#include "DNA_image_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
#include "BKE_animsys.h"
#include "BKE_camera.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_pointcache.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_sequencer.h"
#include "BKE_utildefines.h"
#include "BKE_writeavi.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_path_util.h"
#include "BLI_fileops.h"
#include "BLI_rand.h"
#include "BLI_callbacks.h"
#include "PIL_time.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "RE_engine.h"
#include "RE_pipeline.h"
#include "render_result.h"
#include "render_types.h"
#include "renderpipeline.h"
#include "renderdatabase.h"
#include "rendercore.h"
#include "initrender.h"
#include "shadbuf.h"
#include "pixelblending.h"
#include "zbuf.h"

Go to the source code of this file.

Functions

static int do_write_image_or_movie (Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const char *name_override)
static int thread_break (void *UNUSED(arg))
static void result_nothing (void *UNUSED(arg), RenderResult *UNUSED(rr))
static void result_rcti_nothing (void *UNUSED(arg), RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect))
static void stats_nothing (void *UNUSED(arg), RenderStats *UNUSED(rs))
static void float_nothing (void *UNUSED(arg), float UNUSED(val))
static int default_break (void *UNUSED(arg))
static void stats_background (void *UNUSED(arg), RenderStats *rs)
void RE_FreeRenderResult (RenderResult *res)
float * RE_RenderLayerGetPass (RenderLayer *rl, int passtype)
RenderLayerRE_GetRenderLayer (RenderResult *rr, const char *name)
RenderResultRE_MultilayerConvert (void *exrhandle, int rectx, int recty)
RenderLayerrender_get_active_layer (Render *re, RenderResult *rr)
static int render_scene_needs_vector (Render *re)
RenderRE_GetRender (const char *name)
RenderResultRE_AcquireResultRead (Render *re)
RenderResultRE_AcquireResultWrite (Render *re)
void RE_SwapResult (Render *re, RenderResult **rr)
void RE_ReleaseResult (Render *re)
SceneRE_GetScene (Render *re)
void RE_AcquireResultImage (Render *re, RenderResult *rr)
void RE_ReleaseResultImage (Render *re)
void RE_ResultGet32 (Render *re, unsigned int *rect)
RenderStatsRE_GetStats (Render *re)
RenderRE_NewRender (const char *name)
void RE_InitRenderCB (Render *re)
void RE_FreeRender (Render *re)
void RE_FreeAllRender (void)
void RE_InitState (Render *re, Render *source, RenderData *rd, SceneRenderLayer *srl, int winx, int winy, rcti *disprect)
void RE_SetWindow (Render *re, rctf *viewplane, float clipsta, float clipend)
void RE_SetOrtho (Render *re, rctf *viewplane, float clipsta, float clipend)
void RE_SetView (Render *re, float mat[][4])
void RE_display_init_cb (Render *re, void *handle, void(*f)(void *handle, RenderResult *rr))
void RE_display_clear_cb (Render *re, void *handle, void(*f)(void *handle, RenderResult *rr))
void RE_display_draw_cb (Render *re, void *handle, void(*f)(void *handle, RenderResult *rr, volatile rcti *rect))
void RE_stats_draw_cb (Render *re, void *handle, void(*f)(void *handle, RenderStats *rs))
void RE_progress_cb (Render *re, void *handle, void(*f)(void *handle, float))
void RE_draw_lock_cb (Render *re, void *handle, void(*f)(void *handle, int i))
void RE_test_break_cb (Render *re, void *handle, int(*f)(void *handle))
static int render_display_draw_enabled (Render *re)
static void * do_part_thread (void *pa_v)
float panorama_pixel_rot (Render *re)
static RenderPartfind_next_pano_slice (Render *re, int *minx, rctf *viewplane)
static RenderPartfind_next_part (Render *re, int minx)
static void print_part_stats (Render *re, RenderPart *pa)
static void threaded_tile_processor (Render *re)
void RE_TileProcessor (Render *re)
static void do_render_3d (Render *re)
static void addblur_rect_key (RenderResult *rr, float *rectf, float *rectf1, float blurfac)
static void addblur_rect (RenderResult *rr, float *rectf, float *rectf1, float blurfac, int channels)
static void merge_renderresult_blur (RenderResult *rr, RenderResult *brr, float blurfac, int key_alpha)
static void do_render_blur_3d (Render *re)
static void interleave_rect (RenderResult *rr, float *rectf, float *rectf1, float *rectf2, int channels)
static void merge_renderresult_fields (RenderResult *rr, RenderResult *rr1, RenderResult *rr2)
static void do_render_fields_3d (Render *re)
static void do_render_fields_blur_3d (Render *re)
static void render_scene (Render *re, Scene *sce, int cfra)
static int composite_needs_render (Scene *sce, int this_scene)
static void tag_scenes_for_render (Render *re)
static void ntree_render_scenes (Render *re)
static void render_composit_stats (void *UNUSED(arg), char *str)
static void do_merge_fullsample (Render *re, bNodeTree *ntree)
void RE_MergeFullSample (Render *re, Main *bmain, Scene *sce, bNodeTree *ntree)
static void do_render_composite_fields_blur_3d (Render *re)
static void renderresult_stampinfo (Render *re)
int RE_seq_render_active (Scene *scene, RenderData *rd)
static void do_render_seq (Render *re)
static void do_render_all_options (Render *re)
static int check_valid_camera (Scene *scene, Object *camera_override)
int RE_is_rendering_allowed (Scene *scene, Object *camera_override, ReportList *reports)
static void validate_render_settings (Render *re)
static void update_physics_cache (Render *re, Scene *scene, int UNUSED(anim_init))
static int render_initialize_from_main (Render *re, Main *bmain, Scene *scene, SceneRenderLayer *srl, Object *camera_override, unsigned int lay, int anim, int anim_init)
void RE_SetReports (Render *re, ReportList *reports)
void RE_BlenderFrame (Render *re, Main *bmain, Scene *scene, SceneRenderLayer *srl, Object *camera_override, unsigned int lay, int frame, const short write_still)
void RE_BlenderAnim (Render *re, Main *bmain, Scene *scene, Object *camera_override, unsigned int lay, int sfra, int efra, int tfra)
void RE_PreviewRender (Render *re, Main *bmain, Scene *sce)
int RE_ReadRenderResult (Scene *scene, Scene *scenode)
void RE_set_max_threads (int threads)
void RE_init_threadcount (Render *re)
void RE_layer_load_from_file (RenderLayer *layer, ReportList *reports, const char *filename, int x, int y)
void RE_result_load_from_file (RenderResult *result, ReportList *reports, const char *filename)
int RE_WriteEnvmapResult (struct ReportList *reports, Scene *scene, EnvMap *env, const char *relpath, const char imtype, float layout[12])

Variables

struct {
   ListBase   renderlist
   int   threads
RenderGlobal
Render R
static volatile int g_break = 0
const float default_envmap_layout [] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 }

Detailed Description

Definition in file pipeline.c.


Function Documentation

static void addblur_rect ( RenderResult rr,
float *  rectf,
float *  rectf1,
float  blurfac,
int  channels 
) [static]

Definition at line 976 of file pipeline.c.

References len(), RenderResult::rectx, and RenderResult::recty.

Referenced by merge_renderresult_blur().

static void addblur_rect_key ( RenderResult rr,
float *  rectf,
float *  rectf1,
float  blurfac 
) [static]

Definition at line 940 of file pipeline.c.

References len(), RenderResult::rectx, and RenderResult::recty.

Referenced by merge_renderresult_blur().

static int check_valid_camera ( Scene scene,
Object camera_override 
) [static]
static int composite_needs_render ( Scene sce,
int  this_scene 
) [static]
static int default_break ( void *  UNUSEDarg) [static]

Definition at line 144 of file pipeline.c.

References G.

Referenced by RE_InitRenderCB().

static void do_merge_fullsample ( Render re,
bNodeTree ntree 
) [static]
static void* do_part_thread ( void *  pa_v) [static]
static void do_render_3d ( Render re) [static]
static void do_render_all_options ( Render re) [static]
static void do_render_blur_3d ( Render re) [static]
static void do_render_composite_fields_blur_3d ( Render re) [static]
static void do_render_fields_3d ( Render re) [static]
static void do_render_fields_blur_3d ( Render re) [static]
static void do_render_seq ( Render re) [static]
static int do_write_image_or_movie ( Render re,
Main bmain,
Scene scene,
bMovieHandle mh,
const char *  name_override 
) [static]
static RenderPart* find_next_pano_slice ( Render re,
int *  minx,
rctf viewplane 
) [static]
static RenderPart* find_next_part ( Render re,
int  minx 
) [static]
static void float_nothing ( void *  UNUSEDarg,
float   UNUSEDval 
) [static]

Definition at line 143 of file pipeline.c.

Referenced by RE_InitRenderCB().

static void interleave_rect ( RenderResult rr,
float *  rectf,
float *  rectf1,
float *  rectf2,
int  channels 
) [static]

Definition at line 1064 of file pipeline.c.

References len(), RenderResult::rectx, and RenderResult::recty.

Referenced by merge_renderresult_fields().

static void merge_renderresult_blur ( RenderResult rr,
RenderResult brr,
float  blurfac,
int  key_alpha 
) [static]
static void merge_renderresult_fields ( RenderResult rr,
RenderResult rr1,
RenderResult rr2 
) [static]
static void ntree_render_scenes ( Render re) [static]
float panorama_pixel_rot ( Render re)
static void print_part_stats ( Render re,
RenderPart pa 
) [static]
void RE_AcquireResultImage ( Render re,
RenderResult rr 
)
RenderResult* RE_AcquireResultRead ( Render re) [read]
RenderResult* RE_AcquireResultWrite ( Render re) [read]
void RE_BlenderAnim ( Render re,
Main bmain,
Scene scene,
Object camera_override,
unsigned int  lay,
int  sfra,
int  efra,
int  tfra 
)
void RE_BlenderFrame ( Render re,
Main bmain,
Scene scene,
SceneRenderLayer srl,
Object camera_override,
unsigned int  lay,
int  frame,
const short  write_still 
)
void RE_display_clear_cb ( Render re,
void *  handle,
void(*)(void *handle, RenderResult *rr)  f 
)

Definition at line 561 of file pipeline.c.

References Render::dch, and Render::display_clear.

void RE_display_draw_cb ( Render re,
void *  handle,
void(*)(void *handle, RenderResult *rr, volatile rcti *rect)  f 
)

Definition at line 566 of file pipeline.c.

References Render::ddh, and Render::display_draw.

void RE_display_init_cb ( Render re,
void *  handle,
void(*)(void *handle, RenderResult *rr)  f 
)

Definition at line 556 of file pipeline.c.

References Render::dih, and Render::display_init.

void RE_draw_lock_cb ( Render re,
void *  handle,
void(*)(void *handle, int i f 
)

Definition at line 582 of file pipeline.c.

References Render::draw_lock, and Render::tbh.

void RE_FreeAllRender ( void  )

Definition at line 407 of file pipeline.c.

References RE_FreeRender(), and RenderGlobal.

Referenced by WM_exit_ext().

void RE_FreeRender ( Render re)
void RE_FreeRenderResult ( RenderResult res)
Render* RE_GetRender ( const char *  name) [read]
RenderLayer* RE_GetRenderLayer ( RenderResult rr,
const char *  name 
) [read]
Scene* RE_GetScene ( Render re) [read]

Definition at line 288 of file pipeline.c.

References NULL, and Render::scene.

RenderStats* RE_GetStats ( Render re) [read]

Definition at line 345 of file pipeline.c.

References Render::i.

Referenced by stampdata().

void RE_init_threadcount ( Render re)
void RE_InitRenderCB ( Render re)
void RE_InitState ( Render re,
Render source,
RenderData rd,
SceneRenderLayer srl,
int  winx,
int  winy,
rcti disprect 
)
int RE_is_rendering_allowed ( Scene scene,
Object camera_override,
ReportList reports 
)
void RE_layer_load_from_file ( RenderLayer layer,
ReportList reports,
const char *  filename,
int  x,
int  y 
)
void RE_MergeFullSample ( Render re,
Main bmain,
Scene sce,
bNodeTree ntree 
)
RenderResult* RE_MultilayerConvert ( void *  exrhandle,
int  rectx,
int  recty 
) [read]

Definition at line 210 of file pipeline.c.

References render_result_new_from_exr().

Referenced by image_create_multilayer().

Render* RE_NewRender ( const char *  name) [read]
void RE_PreviewRender ( Render re,
Main bmain,
Scene sce 
)
void RE_progress_cb ( Render re,
void *  handle,
void(*)(void *handle, float)  f 
)

Definition at line 576 of file pipeline.c.

References Render::prh, and Render::progress.

Referenced by screen_render_invoke().

int RE_ReadRenderResult ( Scene scene,
Scene scenode 
)
void RE_ReleaseResult ( Render re)
void RE_ReleaseResultImage ( Render re)
float* RE_RenderLayerGetPass ( RenderLayer rl,
int  passtype 
)
void RE_result_load_from_file ( RenderResult result,
ReportList reports,
const char *  filename 
)

Definition at line 2369 of file pipeline.c.

References BKE_reportf(), render_result_exr_file_read_path(), and RPT_ERROR.

void RE_ResultGet32 ( Render re,
unsigned int *  rect 
)
int RE_seq_render_active ( Scene scene,
RenderData rd 
)
void RE_set_max_threads ( int  threads)

Definition at line 2307 of file pipeline.c.

References BLENDER_MAX_THREADS, BLI_system_thread_count(), RenderGlobal, and threads.

Referenced by set_threads().

void RE_SetOrtho ( Render re,
rctf viewplane,
float  clipsta,
float  clipend 
)
void RE_SetReports ( Render re,
ReportList reports 
)

Definition at line 1989 of file pipeline.c.

References Render::reports.

Referenced by render_animation(), render_frame(), render_startjob(), and screen_render_exec().

void RE_SetView ( Render re,
float  mat[][4] 
)
void RE_SetWindow ( Render re,
rctf viewplane,
float  clipsta,
float  clipend 
)
void RE_stats_draw_cb ( Render re,
void *  handle,
void(*)(void *handle, RenderStats *rs)  f 
)

Definition at line 571 of file pipeline.c.

References Render::sdh, and Render::stats_draw.

Referenced by screen_render_invoke().

void RE_SwapResult ( Render re,
RenderResult **  rr 
)

Definition at line 272 of file pipeline.c.

References Render::result, and SWAP.

Referenced by BKE_image_backup_render().

void RE_test_break_cb ( Render re,
void *  handle,
int(*)(void *handle)  f 
)
void RE_TileProcessor ( Render re)

Definition at line 894 of file pipeline.c.

References threaded_tile_processor().

Referenced by render_envmap(), and sss_create_tree_mat().

int RE_WriteEnvmapResult ( struct ReportList reports,
Scene scene,
EnvMap env,
const char *  relpath,
const char  imtype,
float  layout[12] 
)
static void render_composit_stats ( void *  UNUSEDarg,
char *  str 
) [static]
static int render_display_draw_enabled ( Render re) [static]

Definition at line 608 of file pipeline.c.

References Render::r, R_PREVIEWBUTS, RenderData::scemode, and Render::sss_points.

Referenced by do_part_thread(), and threaded_tile_processor().

RenderLayer* render_get_active_layer ( Render re,
RenderResult rr 
) [read]
static int render_initialize_from_main ( Render re,
Main bmain,
Scene scene,
SceneRenderLayer srl,
Object camera_override,
unsigned int  lay,
int  anim,
int  anim_init 
) [static]
static void render_scene ( Render re,
Scene sce,
int  cfra 
) [static]
static int render_scene_needs_vector ( Render re) [static]
static void renderresult_stampinfo ( Render re) [static]
static void result_nothing ( void *  UNUSEDarg,
RenderResult UNUSEDrr 
) [static]

Definition at line 140 of file pipeline.c.

Referenced by RE_InitRenderCB().

static void result_rcti_nothing ( void *  UNUSEDarg,
RenderResult UNUSEDrr,
volatile struct rcti UNUSEDrect 
) [static]

Definition at line 141 of file pipeline.c.

Referenced by RE_InitRenderCB().

static void stats_background ( void *  UNUSEDarg,
RenderStats rs 
) [static]
static void stats_nothing ( void *  UNUSEDarg,
RenderStats UNUSEDrs 
) [static]

Definition at line 142 of file pipeline.c.

Referenced by RE_InitRenderCB().

static void tag_scenes_for_render ( Render re) [static]
static int thread_break ( void *  UNUSEDarg) [static]

Definition at line 134 of file pipeline.c.

References g_break.

Referenced by threaded_tile_processor().

static void threaded_tile_processor ( Render re) [static]
static void update_physics_cache ( Render re,
Scene scene,
int   UNUSEDanim_init 
) [static]
static void validate_render_settings ( Render re) [static]

Variable Documentation

const float default_envmap_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 }

Definition at line 2377 of file pipeline.c.

Referenced by save_envmap(), and TEXTURE_OT_envmap_save().

volatile int g_break = 0 [static]

Definition at line 133 of file pipeline.c.

Referenced by thread_break(), and threaded_tile_processor().

Definition at line 127 of file pipeline.c.

struct { ... } RenderGlobal [static]

Definition at line 120 of file pipeline.c.

int threads