diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-05-19 04:56:40 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-05-19 04:56:40 +0400 |
commit | b614b81a771df634ad08bafcf1a84b914fe6cb33 (patch) | |
tree | aa458df138e38eb9be564be78ba4ce40f343d7a3 /source/blender/freestyle/intern/system/RenderMonitor.h | |
parent | d12a5d8d63282da6e1f554a50ebbe24649f7b350 (diff) |
Fix for [#35245] Freestyle getting stuck on view map creation + memory leaks.
There were two issues:
- Line visibility computations are very slow in the case of the provided .blend file, which gave
an impression that the rendering process got stuck. The slowness can be explained by the present
data structures used for the line visibility computations, together with the specific mesh distribution
of the test scene. At the moment Freestyle uses a regular grid in the 2D image coordinate system
to divide tris/quads into small groups in order to accelerate the line visibility computations.
On the other hand, the test scene is populated a big plane (made of one quad) and a moderately
detailed mesh object (22K tris). The scale of the latter mesh is animated from nearly zero to
about 0.2 to make the object show up over time. When the scale is nearly equal to zero, all the
tris concentrate in one grid cell, so essentially there is no performance gain from the grid data
structure optimized for speed. It looks like a better grid data structure (possibly based on
adaptive grid refinement) is necessary to genuinely address the identified performance issue. For now
the progress bar of Blender is employed to better inform users of the amount of work done in the line
visibility computations.
- A crash was caused by an excessive memory allocation request. The X and Y dimensions of the grid
data structure are determined based on the average area of mesh faces in the given scene. When the big
plane in the test scene is excluded from the rendering, the average area is almost zero (on the order
of 1e-5). As a result of this extremely small average area, the X and Y dimensions were set to a very
large number, causing a fatal memory allocation error. The present revision has introduced a hard
upper limit to the dimensions of the grid data structure to avoid this kind of numerical instability.
Diffstat (limited to 'source/blender/freestyle/intern/system/RenderMonitor.h')
-rw-r--r-- | source/blender/freestyle/intern/system/RenderMonitor.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/system/RenderMonitor.h b/source/blender/freestyle/intern/system/RenderMonitor.h index 9e801f21210..0453f81e5b5 100644 --- a/source/blender/freestyle/intern/system/RenderMonitor.h +++ b/source/blender/freestyle/intern/system/RenderMonitor.h @@ -48,6 +48,21 @@ public: virtual ~RenderMonitor() {} + inline void setInfo(string info) + { + if (_re && !info.empty()) { + _re->i.infostr = info.c_str(); + _re->stats_draw(_re->sdh, &_re->i); + _re->i.infostr = NULL; + } + } + + inline void progress(float i) + { + if (_re) + _re->progress(_re->prh, i); + } + inline bool testBreak() { return _re && _re->test_break(_re->tbh); |