diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-11-26 06:32:34 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-11-26 06:32:34 +0400 |
commit | 53840c7db5114da8b35fb12c1cfa49427802b0d7 (patch) | |
tree | e1676e61881c903baff02bd69290ef0393a13465 /source/blender/render | |
parent | b7cd9ec3ada529bf1d57cf08cc96851ceb67a47d (diff) | |
parent | 97b8a1f752fbe729c20c8398dfa9fdbc2e2e4ff3 (diff) |
Merged changes in the trunk up to revision 52546.
Conflicts resolved:
release/datafiles/startup.blend
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/idcode.c
Diffstat (limited to 'source/blender/render')
8 files changed, 54 insertions, 36 deletions
diff --git a/source/blender/render/intern/include/initrender.h b/source/blender/render/intern/include/initrender.h index 43ab9552194..73dc29c8feb 100644 --- a/source/blender/render/intern/include/initrender.h +++ b/source/blender/render/intern/include/initrender.h @@ -40,8 +40,9 @@ struct Object; void free_sample_tables(Render *re); void make_sample_tables(Render *re); -void initparts(Render *re, int do_crop); -void freeparts(Render *re); +void RE_parts_clamp(Render *re); +void RE_parts_init(Render *re, int do_crop); +void RE_parts_free(Render *re); #endif /* __INITRENDER_H__ */ diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 47bff762d13..6993e1baab4 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -126,7 +126,9 @@ #define FLT_EPSILON10 1.19209290e-06F /* could enable at some point but for now there are far too many conversions */ -#pragma GCC diagnostic ignored "-Wdouble-promotion" +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wdouble-promotion" +#endif /* ------------------------------------------------------------------------- */ diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 9053bc84bbc..6fdf11ba48c 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -376,7 +376,7 @@ int RE_engine_render(Render *re, int do_all) if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_PREVIEWBUTS)) == 0) BKE_scene_update_for_newframe(re->main, re->scene, re->lay); - initparts(re, FALSE); + RE_parts_init(re, FALSE); engine->tile_x = re->partx; engine->tile_y = re->party; @@ -393,6 +393,8 @@ int RE_engine_render(Render *re, int do_all) engine->tile_y = 0; engine->flag &= ~RE_ENGINE_RENDERING; + render_result_free_list(&engine->fullresult, engine->fullresult.first); + /* re->engine becomes zero if user changed active render engine during render */ if (!persistent_data || !re->engine) { RE_engine_free(engine); @@ -405,9 +407,7 @@ int RE_engine_render(Render *re, int do_all) BLI_rw_mutex_unlock(&re->resultmutex); } - freeparts(re); - - render_result_free_list(&engine->fullresult, engine->fullresult.first); + RE_parts_free(re); if (BKE_reports_contain(re->reports, RPT_ERROR)) G.is_break = TRUE; diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index b2cf8db7995..3ea74abbcc2 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -525,7 +525,7 @@ void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, flo /* ~~~~~~~~~~~~~~~~ part (tile) calculus ~~~~~~~~~~~~~~~~~~~~~~ */ -void freeparts(Render *re) +void RE_parts_free(Render *re) { RenderPart *part = re->parts.first; @@ -537,12 +537,19 @@ void freeparts(Render *re) BLI_freelistN(&re->parts); } -void initparts(Render *re, int do_crop) +void RE_parts_clamp(Render *re) +{ + /* part size */ + re->partx = min_ii(re->r.tilex, re->rectx); + re->party = min_ii(re->r.tiley, re->recty); +} + +void RE_parts_init(Render *re, int do_crop) { int nr, xd, yd, partx, party, xparts, yparts; int xminb, xmaxb, yminb, ymaxb; - freeparts(re); + RE_parts_free(re); /* this is render info for caller, is not reset when parts are freed! */ re->i.totpart = 0; @@ -555,13 +562,10 @@ void initparts(Render *re, int do_crop) xmaxb = re->disprect.xmax; ymaxb = re->disprect.ymax; - /* part size */ - partx = min_ii(re->r.tilex, re->rectx); - party = min_ii(re->r.tiley, re->recty); - - re->partx = partx; - re->party = party; - + RE_parts_clamp(re); + + partx = re->partx; + party = re->party; /* part count */ xparts = (re->rectx + partx - 1) / partx; yparts = (re->recty + party - 1) / party; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 75d45144ccd..24b0830e651 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -696,7 +696,7 @@ static void *do_part_thread(void *pa_v) /* calculus for how much 1 pixel rendered should rotate the 3d geometry */ /* is not that simple, needs to be corrected for errors of larger viewplane sizes */ -/* called in initrender.c, initparts() and convertblender.c, for speedvectors */ +/* called in initrender.c, RE_parts_init() and convertblender.c, for speedvectors */ float panorama_pixel_rot(Render *re) { float psize, phi, xfac; @@ -839,7 +839,7 @@ static void threaded_tile_processor(Render *re) /* warning; no return here without closing exr file */ - initparts(re, TRUE); + RE_parts_init(re, TRUE); if (re->result->do_exr_tile) render_result_exr_file_begin(re); @@ -931,7 +931,7 @@ static void threaded_tile_processor(Render *re) g_break = 0; BLI_end_threads(&threads); - freeparts(re); + RE_parts_free(re); re->viewplane = viewplane; /* restore viewplane, modified by pano render */ } @@ -952,6 +952,7 @@ static void do_render_3d(Render *re) return; /* internal */ + RE_parts_clamp(re); // re->cfra= cfra; /* <- unused! */ re->scene->r.subframe = re->mblur_offs + re->field_offs; diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 7a7602dcce2..44daaf516e1 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1179,30 +1179,36 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater /* -------------------------- operations on entire database ----------------------- */ /* ugly function for halos in panorama */ -static int panotestclip(Render *re, int do_pano, float *v) +static int panotestclip(Render *re, int do_pano, float v[4]) { - /* to be used for halos en infos */ - float abs4; - short c=0; - int xparts = (re->rectx + re->partx - 1) / re->partx; + /* part size (ensure we run RE_parts_clamp first) */ + BLI_assert(re->partx == min_ii(re->r.tilex, re->rectx)); + BLI_assert(re->party == min_ii(re->r.tiley, re->recty)); if (do_pano == FALSE) { return testclip(v); } + else { + /* to be used for halos en infos */ + float abs4; + short c = 0; + + int xparts = (re->rectx + re->partx - 1) / re->partx; - abs4= fabs(v[3]); + abs4= fabsf(v[3]); - if (v[2]< -abs4) c=16; /* this used to be " if (v[2]<0) ", see clippz() */ - else if (v[2]> abs4) c+= 32; + if (v[2]< -abs4) c=16; /* this used to be " if (v[2]<0) ", see clippz() */ + else if (v[2]> abs4) c+= 32; - if ( v[1]>abs4) c+=4; - else if ( v[1]< -abs4) c+=8; + if ( v[1]>abs4) c+=4; + else if ( v[1]< -abs4) c+=8; - abs4*= xparts; - if ( v[0]>abs4) c+=2; - else if ( v[0]< -abs4) c+=1; + abs4*= xparts; + if ( v[0]>abs4) c+=2; + else if ( v[0]< -abs4) c+=1; - return c; + return c; + } } /** diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index dfa1bec5f8c..a425d9a330b 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -58,7 +58,9 @@ #include "shading.h" /* own include */ /* could enable at some point but for now there are far too many conversions */ -#pragma GCC diagnostic ignored "-Wdouble-promotion" +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wdouble-promotion" +#endif /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 62bf9ac2005..c52fb84a7f8 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -77,7 +77,9 @@ #include "zbuf.h" /* could enable at some point but for now there are far too many conversions */ -#pragma GCC diagnostic ignored "-Wdouble-promotion" +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wdouble-promotion" +#endif /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ |