[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15303] branches/soc-2008-unclezeiv/source /blender/render/intern/source/lightcuts.c: - tree creation time now printed on standard output
Davide Vercelli
davide.vercelli at gmail.com
Sun Jun 22 03:56:24 CEST 2008
Revision: 15303
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15303
Author: unclezeiv
Date: 2008-06-22 03:56:06 +0200 (Sun, 22 Jun 2008)
Log Message:
-----------
- tree creation time now printed on standard output
- the tree building phase is now also mentioned in the infostring
Modified Paths:
--------------
branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c
Modified: branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c
===================================================================
--- branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c 2008-06-22 01:31:29 UTC (rev 15302)
+++ branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c 2008-06-22 01:56:06 UTC (rev 15303)
@@ -38,6 +38,7 @@
#include "DNA_lamp_types.h"
#include "DNA_listBase.h"
#include "MEM_guardedalloc.h"
+#include "PIL_time.h"
#include "RE_pipeline.h"
#include "blendef.h"
@@ -131,6 +132,9 @@
int stat_samples;
int stat_cut_size;
int stat_rays_shot;
+
+ double start_time;
+ double tree_creation_time;
} LightcutsData;
#define VEC_LEN_SQ(v) (v[0]*v[0] + v[1]*v[1] + v[2]*v[2])
@@ -437,11 +441,15 @@
ListBase *lights = &re->lights;
ListBase *pointlights;
LampRen *lar;
+ char tree_time_str[12]; /* length 12 required by BLI_timestr */
#ifdef LIGHTCUTS_CURRENTLY_UNUSED
LampRen *larnew;
float r, g, b, n;
#endif
+
+ re->i.infostr= "Initializing Lightcuts";
+ re->stats_draw(&re->i);
re->lcdata = lcd = MEM_callocN(sizeof(LightcutsData), "LightcutsData");
pointlights= &lcd->pointlights;
@@ -535,6 +543,10 @@
lcd->max_lights= lcd->light_counter;
lcd->error_rate= re->r.lightcuts_max_error;
lcd->max_cut= MIN2(re->r.lightcuts_max_cut, lcd->light_counter);
+ lcd->start_time= PIL_check_seconds_timer();
+
+ re->i.infostr= "Building light trees";
+ re->stats_draw(&re->i);
/* build LA_LOCAL tree */
if (lcd->trees[TREE_LOCAL].counter > 0) {
@@ -549,9 +561,16 @@
printf("Lightcuts: directional (Sun) lights tree built - ");
lightcuts_build_tree(&lcd->trees[TREE_SUN]);
}
+
+ lcd->tree_creation_time= PIL_check_seconds_timer() - lcd->start_time;
+ BLI_timestr(lcd->tree_creation_time, tree_time_str);
+ printf("Tree creation time: %12s\n", tree_time_str);
lcd->cut_nodes_size= (lcd->max_lights * 2 + 1);
lcd->cut_nodes= MEM_callocN(sizeof(CutNode) * lcd->cut_nodes_size * re->r.threads, "cut_nodes");
+
+ re->i.infostr= NULL;
+ re->stats_draw(&re->i);
}
/* Adapted from "Transforming Axis-Aligned Bounding Boxes" by Jim Arvo, "Graphics Gems", Academic Press, 1990 */
More information about the Bf-blender-cvs
mailing list