diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-15 14:28:32 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-15 14:28:32 +0400 |
commit | 9a85013692322f8a821b8228ad552f84d2a215e9 (patch) | |
tree | 666bb54fa093429d65b6b0322e8058c03f5fe223 /source/blender/render/intern | |
parent | 2b018673509fe7a38a6332fae00bd605335bd286 (diff) |
Merge various small changes from render branch:
* Division by zero fix for TNT SVD code.
* Sound fix, in case ffmpeg decode fails, don't use the samples.
* Fix for incorrect bounds of transformed objects in new raytracing code.
* Gave memory arena's a name used for allocations for easier memory
usage debugging.
* Dupligroup no_draw option was using layers but not restrict view/render
setting. (not a bugfix exactly but would do display list context switching
while drawing for no reason).
* Fix objects instanced on hair particles not giving consistent results
when the object is transformed.
* New math functions: madd_v4_v4fl, len_squared_v3v3, interp_v4_v4v4v4,
mul_v4_m4v4, SH and form factor functions, box_minmax_bounds_m4.
* mul_m4_m4m4 and mul_m3_m3m3 now accept the same pointers for multiple
arguments.
* endjob callback for WM jobs system.
* Geometry node uv/color layer now has search list/autocomplete.
* Various small buildsystem tweaks, not strictly needed yet in trunk.
Diffstat (limited to 'source/blender/render/intern')
11 files changed, 35 insertions, 25 deletions
diff --git a/source/blender/render/intern/raytrace/Makefile b/source/blender/render/intern/raytrace/Makefile index 6e40c544c6f..c136f945ca5 100644 --- a/source/blender/render/intern/raytrace/Makefile +++ b/source/blender/render/intern/raytrace/Makefile @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/render/intern/raytrace/rayobject.cpp b/source/blender/render/intern/raytrace/rayobject.cpp index b9e9a46b1a9..84ec56e131a 100644 --- a/source/blender/render/intern/raytrace/rayobject.cpp +++ b/source/blender/render/intern/raytrace/rayobject.cpp @@ -497,12 +497,22 @@ void RE_rayobject_merge_bb(RayObject *r, float *min, float *max) else if(RE_rayobject_isVlakPrimitive(r)) { VlakPrimitive *face = (VlakPrimitive*) RE_rayobject_align(r); - VlakRen *vlr = face->face; + RayFace nface; + RE_rayface_from_vlak(&nface, face->ob, face->face); + + if(face->ob->transform_primitives) + { + mul_m4_v3(face->ob->mat, nface.v1); + mul_m4_v3(face->ob->mat, nface.v2); + mul_m4_v3(face->ob->mat, nface.v3); + if(RE_rayface_isQuad(&nface)) + mul_m4_v3(face->ob->mat, nface.v4); + } - DO_MINMAX( vlr->v1->co, min, max ); - DO_MINMAX( vlr->v2->co, min, max ); - DO_MINMAX( vlr->v3->co, min, max ); - if(vlr->v4) DO_MINMAX( vlr->v4->co, min, max ); + DO_MINMAX( nface.v1, min, max ); + DO_MINMAX( nface.v2, min, max ); + DO_MINMAX( nface.v3, min, max ); + if(RE_rayface_isQuad(&nface)) DO_MINMAX( nface.v4, min, max ); } else if(RE_rayobject_isRayAPI(r)) { diff --git a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp index cdc3be4c521..afffdd44f1f 100644 --- a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp @@ -52,10 +52,10 @@ void bvh_done<QBVHTree>(QBVHTree *obj) rtbuild_done(obj->builder, &obj->rayobj.control); //TODO find a away to exactly calculate the needed memory - MemArena *arena1 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + MemArena *arena1 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "qbvh arena"); BLI_memarena_use_malloc(arena1); - MemArena *arena2 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + MemArena *arena2 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "qbvh arena 2"); BLI_memarena_use_malloc(arena2); BLI_memarena_use_align(arena2, 16); diff --git a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp index 67af596e301..389512ce469 100644 --- a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp @@ -63,10 +63,10 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj) rtbuild_done(obj->builder, &obj->rayobj.control); //TODO find a away to exactly calculate the needed memory - MemArena *arena1 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + MemArena *arena1 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "svbvh arena"); BLI_memarena_use_malloc(arena1); - MemArena *arena2 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + MemArena *arena2 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "svbvh arena2"); BLI_memarena_use_malloc(arena2); BLI_memarena_use_align(arena2, 16); diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp index 0190b971d84..de1e6d349be 100644 --- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp @@ -76,7 +76,7 @@ void bvh_done<VBVHTree>(VBVHTree *obj) rtbuild_done(obj->builder, &obj->rayobj.control); //TODO find a away to exactly calculate the needed memory - MemArena *arena1 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + MemArena *arena1 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "vbvh arena"); BLI_memarena_use_malloc(arena1); //Build and optimize the tree @@ -101,7 +101,7 @@ void bvh_done<VBVHTree>(VBVHTree *obj) { /* TODO - MemArena *arena2 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + MemArena *arena2 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "vbvh arena2"); BLI_memarena_use_malloc(arena2); //Finds the optimal packing of this tree using a given cost model diff --git a/source/blender/render/intern/source/Makefile b/source/blender/render/intern/source/Makefile index c313549f9b9..5aaa66e7712 100644 --- a/source/blender/render/intern/source/Makefile +++ b/source/blender/render/intern/source/Makefile @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. # All rights reserved. diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index db242b0b1d9..189c029d2e2 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -512,7 +512,7 @@ static void calc_vertexnormals(Render *re, ObjectRen *obr, int do_tangent, int d int a; if(do_nmap_tangent) { - arena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + arena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "nmap tangent arena"); BLI_memarena_use_calloc(arena); vtangents= MEM_callocN(sizeof(VertexTangent*)*obr->totvert, "VertexTangent"); @@ -4949,7 +4949,7 @@ void RE_Database_FromScene(Render *re, Scene *scene, unsigned int lay, int use_c /* XXX add test if dbase was filled already? */ - re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "render db arena"); re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0; re->lights.first= re->lights.last= NULL; re->lampren.first= re->lampren.last= NULL; @@ -5099,7 +5099,7 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la /* XXX add test if dbase was filled already? */ - re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "vector render db arena"); re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0; re->i.totface=re->i.totvert=re->i.totstrand=re->i.totlamp=re->i.tothalo= 0; re->lights.first= re->lights.last= NULL; @@ -5635,7 +5635,7 @@ void RE_Database_Baking(Render *re, Scene *scene, unsigned int lay, int type, Ob } /* setup render stuff */ - re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + re->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "bake db arena"); re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0; re->lights.first= re->lights.last= NULL; diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index ab656ad1c3b..ff718359a3e 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -660,7 +660,7 @@ static OcclusionTree *occ_tree_build(Render *re) tree->doindirect= (re->wrld.ao_indirect_energy > 0.0f && re->wrld.ao_indirect_bounces > 0); /* allocation */ - tree->arena= BLI_memarena_new(0x8000 * sizeof(OccNode)); + tree->arena= BLI_memarena_new(0x8000 * sizeof(OccNode), "occ tree arena"); BLI_memarena_use_calloc(tree->arena); if(re->wrld.aomode & WO_AOCACHE) diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 35d969f9f21..7101ce5daaf 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -2204,7 +2204,7 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar) isbdata->recty= pa->recty; /* branches are added using memarena (32k branches) */ - memarena = BLI_memarena_new(0x8000 * sizeof(ISBBranch)); + memarena = BLI_memarena_new(0x8000 * sizeof(ISBBranch), "isb arena"); BLI_memarena_use_calloc(memarena); /* samplebuf is in camera view space (pixels) */ @@ -2300,7 +2300,7 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar) if(R.osa) { ISBShadfacA **isbsa= isbdata->shadfaca= MEM_callocN(pa->rectx*pa->recty*sizeof(void *), "isb shadfacs"); - isbdata->memarena = BLI_memarena_new(0x8000 * sizeof(ISBSampleA)); + isbdata->memarena = BLI_memarena_new(0x8000 * sizeof(ISBSampleA), "isb arena"); BLI_memarena_use_calloc(isbdata->memarena); for(rd= pa->rectdaps, x=pa->rectx*pa->recty; x>0; x--, rd++, isbsa++) { @@ -2412,7 +2412,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la isbdata->recty= pa->recty; /* branches are added using memarena (32k branches) */ - memarena = BLI_memarena_new(0x8000 * sizeof(ISBBranch)); + memarena = BLI_memarena_new(0x8000 * sizeof(ISBBranch), "isb arena"); BLI_memarena_use_calloc(memarena); /* samplebuf is in camera view space (pixels) */ @@ -2503,7 +2503,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la /* copy shadow samples to persistant buffer, reduce memory overhead */ isbsa= isbdata->shadfaca= MEM_callocN(pa->rectx*pa->recty*sizeof(void *), "isb shadfacs"); - isbdata->memarena = BLI_memarena_new(0x8000 * sizeof(ISBSampleA)); + isbdata->memarena = BLI_memarena_new(0x8000 * sizeof(ISBSampleA), "isb arena"); for(ap= apixbuf, x=pa->rectx*pa->recty; x>0; x--, ap++, isbsa++) { diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c index 836a60ef4f9..bb5f8e9b8b4 100644 --- a/source/blender/render/intern/source/sss.c +++ b/source/blender/render/intern/source/sss.c @@ -779,7 +779,7 @@ void scatter_tree_build(ScatterTree *tree) tmppoints= MEM_callocN(sizeof(ScatterPoint*)*totpoint, "ScatterTmpPoints"); tree->tmppoints= tmppoints; - tree->arena= BLI_memarena_new(0x8000 * sizeof(ScatterNode)); + tree->arena= BLI_memarena_new(0x8000 * sizeof(ScatterNode), "sss tree arena"); BLI_memarena_use_calloc(tree->arena); /* build tree */ diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c index 1bf1f1fe582..e3428741473 100644 --- a/source/blender/render/intern/source/strand.c +++ b/source/blender/render/intern/source/strand.c @@ -320,7 +320,7 @@ StrandShadeCache *strand_shade_cache_create() cache= MEM_callocN(sizeof(StrandShadeCache), "StrandShadeCache"); cache->resulthash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); cache->refcounthash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - cache->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + cache->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "strand shade cache arena"); return cache; } @@ -818,7 +818,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa bounds[2]= (2*pa->disprect.ymin - winy-1)/(float)winy; bounds[3]= (2*pa->disprect.ymax - winy+1)/(float)winy; - memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); + memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "strand sort arena"); firstseg= NULL; sortseg= sortsegments; totsegment= 0; |