Freestyle getting stuck on view map creation + memory leaks #35245

Closed
opened 2013-05-07 10:12:06 +02:00 by Antonis Ryakiotakis · 4 comments

%%%--- Operating System, Graphics card ---
Windows 7 - ubuntu 13.04 Geforce GT 540M

- Blender version with error, and version that worked ---

r56521 is buggy

- Short description of error ---

Blender stops at view map creation when rendering. This is no hang, it can be exited with escape but processing does not proceed. If the renderability of the visible plane is toggled off, a hard crash occurs (tested on Windows only)

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Press render on attached file.
%%%

%%%--- Operating System, Graphics card --- Windows 7 - ubuntu 13.04 Geforce GT 540M - Blender version with error, and version that worked --- r56521 is buggy - Short description of error --- Blender stops at view map creation when rendering. This is no hang, it can be exited with escape but processing does not proceed. If the renderability of the visible plane is toggled off, a hard crash occurs (tested on Windows only) - Steps for others to reproduce the error (preferably based on attached .blend file) --- Press render on attached file. %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%Confirmed. Looks like Freestyle has some problems with very small faces, the scale of these objects is animated to make them disappear.%%%

%%%Confirmed. Looks like Freestyle has some problems with very small faces, the scale of these objects is animated to make them disappear.%%%

%%%Made an attempt to fix the reported problems in the trunk revision 56905. Indeed 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 a data structure used for the line visibility computations, together with a 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 by 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 intended for speed optimization. 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.

It would be appreciated if you could test the fixes on your side. The development of a faster line visibility algorithm is kept as a future to-do item for now.%%%

%%%Made an attempt to fix the reported problems in the trunk revision 56905. Indeed 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 a data structure used for the line visibility computations, together with a 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 by 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 intended for speed optimization. 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. It would be appreciated if you could test the fixes on your side. The development of a faster line visibility algorithm is kept as a future to-do item for now.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#35245
No description provided.