diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-06-30 01:50:53 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-06-30 01:50:53 +0400 |
commit | dd7463bd4d0457a6b11515d14cce7871fe5f6fd5 (patch) | |
tree | 37830d0513c8926eeeb34949afa09ed738daf3da /source/blender/render | |
parent | 1136656bbadc92936fa497e2ddd99bae1b982982 (diff) | |
parent | 5d491681e0d1e6b8450dedc64bd45408bb9066cd (diff) |
svn merge -r 21041:21243 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/extern/include/RE_render_ext.h | 3 | ||||
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 10 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 20 | ||||
-rw-r--r-- | source/blender/render/intern/source/zbuf.c | 108 |
4 files changed, 29 insertions, 112 deletions
diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h index 20eea0c98bd..15b59f2c8cc 100644 --- a/source/blender/render/extern/include/RE_render_ext.h +++ b/source/blender/render/extern/include/RE_render_ext.h @@ -47,7 +47,8 @@ struct Render; struct MTex; struct ImBuf; -void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem, struct Render *re); +// RADIO REMOVED, Maybe this will be useful later +//void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem, struct Render *re); /* particle.c, effect.c, editmesh_modes.c and brush.c, returns 1 if rgb, 0 otherwise */ int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 98e5819c0d3..a00cd2211fc 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -104,7 +104,6 @@ #include "rendercore.h" #include "renderdatabase.h" #include "renderpipeline.h" -#include "radio.h" #include "shadbuf.h" #include "shading.h" #include "strand.h" @@ -1886,6 +1885,9 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(psys_get_particle_state(re->scene,ob,psys,a,&state,0)==0) continue; + if(psys->parent) + Mat4MulVecfl(psys->parent->obmat, state.co); + VECCOPY(loc,state.co); if(part->ren_as!=PART_DRAW_BB) MTC_Mat4MulVecfl(re->viewmat,loc); @@ -4308,8 +4310,9 @@ void RE_Database_Free(Render *re) } free_mesh_orco_hash(re); - +#if 0 /* radio can be redone better */ end_radio_render(); +#endif end_render_materials(); end_render_textures(); @@ -4736,10 +4739,11 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* yafray: 'direct' radiosity, environment maps and raytree init not needed for yafray render */ /* although radio mode could be useful at some point, later */ if (re->r.renderer==R_INTERN) { +#if 0 /* RADIO was removed */ /* RADIO (uses no R anymore) */ if(!re->test_break(re->tbh)) if(re->r.mode & R_RADIO) do_radio_render(re); - +#endif /* raytree */ if(!re->test_break(re->tbh)) { if(re->r.mode & R_RAYTRACE) { diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 07560edb76b..ccc793e4235 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -46,6 +46,7 @@ #include "BKE_object.h" #include "BKE_scene.h" #include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */ +#include "BKE_pointcache.h" #include "MEM_guardedalloc.h" @@ -61,7 +62,6 @@ #include "intern/openexr/openexr_multi.h" #include "RE_pipeline.h" -#include "radio.h" /* internal */ #include "render_types.h" @@ -2413,6 +2413,21 @@ static int is_rendering_allowed(Render *re) return 1; } +static void update_physics_cache(Render *re, Scene *scene) +{ + PTCacheBaker baker; + + baker.scene = scene; + baker.pid = NULL; + baker.bake = 0; + baker.render = 1; + baker.quick_step = 1; + baker.break_test = re->test_break; + baker.break_data = re->tbh; + baker.progressbar = NULL; + + BKE_ptcache_make_cache(&baker); +} /* evaluating scene options for general Blender render */ static int render_initialize_from_scene(Render *re, Scene *scene, int anim) { @@ -2450,6 +2465,9 @@ static int render_initialize_from_scene(Render *re, Scene *scene, int anim) /* check all scenes involved */ tag_scenes_for_render(re); + + /* make sure dynamics are up to date */ + update_physics_cache(re, scene); if(scene->r.scemode & R_SINGLE_LAYER) push_render_result(re); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index b68cecce7bd..21c3977fc0b 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -49,14 +49,12 @@ #include "DNA_mesh_types.h" #include "DNA_node_types.h" #include "DNA_meshdata_types.h" +#include "DNA_material_types.h" #include "BKE_global.h" #include "BKE_material.h" #include "BKE_utildefines.h" -#include "radio_types.h" -#include "radio.h" /* needs RG, some root data for radiosity */ - #include "RE_render_ext.h" /* local includes */ @@ -2301,110 +2299,6 @@ static int hashlist_projectvert(float *v1, float winmat[][4], float *hoco) return buck->clip; } -/* used for booth radio 'tool' as during render */ -void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem, Render *re) -{ - ZSpan zspan; - float hoco[4][4], winmat[4][4]; - int a, zvlnr; - int c1, c2, c3, c4= 0; - - if(rg_totelem==0) return; - - hashlist_projectvert(NULL, winmat, NULL); - - /* needed for projectvert */ - MTC_Mat4MulMat4(winmat, vw->viewmat, vw->winmat); - - /* 1.0f for clipping in clippyra()... bad stuff actually */ - zbuf_alloc_span(&zspan, vw->rectx, vw->recty, 1.0f); - zspan.zmulx= ((float)vw->rectx)/2.0; - zspan.zmuly= ((float)vw->recty)/2.0; - zspan.zofsx= -0.5f; - zspan.zofsy= -0.5f; - - /* the buffers */ - zspan.rectz= (int *)vw->rectz; - zspan.rectp= (int *)vw->rect; - zspan.recto= MEM_callocN(sizeof(int)*vw->rectx*vw->recty, "radiorecto"); - fillrect(zspan.rectz, vw->rectx, vw->recty, 0x7FFFFFFF); - fillrect(zspan.rectp, vw->rectx, vw->recty, 0xFFFFFF); - - /* filling methods */ - zspan.zbuffunc= zbuffillGL4; - - if(rg_elem) { /* radio tool */ - RNode **re, *rn; - - re= rg_elem; - re+= (rg_totelem-1); - for(a= rg_totelem-1; a>=0; a--, re--) { - rn= *re; - if( (rn->f & RAD_SHOOT)==0 ) { /* no shootelement */ - - if( rn->f & RAD_TWOSIDED) zvlnr= a; - else if( rn->f & RAD_BACKFACE) zvlnr= 0xFFFFFF; - else zvlnr= a; - - c1= hashlist_projectvert(rn->v1, winmat, hoco[0]); - c2= hashlist_projectvert(rn->v2, winmat, hoco[1]); - c3= hashlist_projectvert(rn->v3, winmat, hoco[2]); - - if(rn->v4) { - c4= hashlist_projectvert(rn->v4, winmat, hoco[3]); - } - - if(rn->v4) - zbufclip4(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4); - else - zbufclip(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); - } - } - } - else { /* radio render */ - ObjectRen *obr; - VlakRen *vlr=NULL; - RadFace **radface, *rf; - int totface=0; - - /* note: radio render doesn't support duplis */ - for(obr=re->objecttable.first; obr; obr=obr->next) { - hashlist_projectvert(NULL, NULL, NULL); /* clear hashlist */ - - for(a=0; a<obr->totvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if((radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - if( (rf->flag & RAD_SHOOT)==0 ) { /* no shootelement */ - - if( rf->flag & RAD_TWOSIDED) zvlnr= totface; - else if( rf->flag & RAD_BACKFACE) zvlnr= 0xFFFFFF; /* receives no energy, but is zbuffered */ - else zvlnr= totface; - - c1= hashlist_projectvert(vlr->v1->co, winmat, hoco[0]); - c2= hashlist_projectvert(vlr->v2->co, winmat, hoco[1]); - c3= hashlist_projectvert(vlr->v3->co, winmat, hoco[2]); - - if(vlr->v4) { - c4= hashlist_projectvert(vlr->v4->co, winmat, hoco[3]); - } - - if(vlr->v4) - zbufclip4(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4); - else - zbufclip(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); - } - totface++; - } - } - } - } - - MEM_freeN(zspan.recto); - zbuf_free_span(&zspan); -} - void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int size, float jitx, float jity) { ZbufProjectCache cache[ZBUF_PROJECT_CACHE_SIZE]; |