Blender Internal: render preview with Freestyle + full-sample AA generates many unneeded .exr files #57388

Closed
opened 2018-10-26 08:45:45 +02:00 by Shinsuke Irie · 4 comments
Member

System Information
Ubuntu 18.10

Blender Version
Broken: 2.79b or earlier

Short description of error
When using Freestyle and full-sample AA, render preview in 3D viewport spends a very long time and wastes disk space for generating many .exr files not to be used each time the viewport is redrawn.

Example of console output:

write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer1.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer2.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer3.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer4.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer5.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer6.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer7.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer8.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer9.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer10.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer11.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer12.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer13.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer14.exr
write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer15.exr
read exr tmp file: /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer.exr

In this case, only "Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer.exr" is used for rendering later but the remaining files are never used.

Exact steps for others to reproduce the error
Freestyle_fullsampleAA16.blend

  • Start Blender from command line
  • Open attached .blend file
  • Set the display method "Render" (shift+z)
  • Move/rotate/zoom the view to redraw

Cause and possible solution
I found that 'R_FULL_SAMPLE' flag not inherited from BI render to FRS render causes the problem.
The following patch seems to resolve the issue:

diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index 9c3ff8999b7..94a70761dc2 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -96,7 +96,8 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str
        //freestyle_scene->r.maximsize = old_scene->r.maximsize; /* DEPRECATED */
        freestyle_scene->r.ocres = old_scene->r.ocres;
        freestyle_scene->r.color_mgt_flag = 0; // old_scene->r.color_mgt_flag;
-       freestyle_scene->r.scemode = old_scene->r.scemode & ~(R_SINGLE_LAYER | R_NO_FRAME_UPDATE | R_MULTIVIEW);
+       freestyle_scene->r.scemode = old_scene->r.scemode & ~(R_SINGLE_LAYER | R_NO_FRAME_UPDATE | R_MULTIVIEW) &
+                                    (re->r.scemode | ~R_FULL_SAMPLE);
        freestyle_scene->r.flag = old_scene->r.flag;
        freestyle_scene->r.threads = old_scene->r.threads;
        freestyle_scene->r.border.xmin = old_scene->r.border.xmin;
**System Information** Ubuntu 18.10 **Blender Version** Broken: 2.79b or earlier **Short description of error** When using Freestyle and full-sample AA, render preview in 3D viewport spends a very long time and wastes disk space for generating many .exr files not to be used each time the viewport is redrawn. Example of console output: ``` write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer1.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer2.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer3.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer4.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer5.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer6.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer7.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer8.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer9.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer10.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer11.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer12.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer13.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer14.exr write exr tmp file, 1665x883, /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer15.exr read exr tmp file: /tmp/blender_D3e5mT/Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer.exr ``` In this case, only "Freestyle_fullsampleAA.blend_FRS1_Scene_RenderLayer.exr" is used for rendering later but the remaining files are never used. **Exact steps for others to reproduce the error** [Freestyle_fullsampleAA16.blend](https://archive.blender.org/developer/F5237118/Freestyle_fullsampleAA16.blend) - Start Blender from command line - Open attached .blend file - Set the display method "Render" (shift+z) - Move/rotate/zoom the view to redraw **Cause and possible solution** I found that 'R_FULL_SAMPLE' flag not inherited from BI render to FRS render causes the problem. The following patch seems to resolve the issue: ``` diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 9c3ff8999b7..94a70761dc2 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -96,7 +96,8 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str //freestyle_scene->r.maximsize = old_scene->r.maximsize; /* DEPRECATED */ freestyle_scene->r.ocres = old_scene->r.ocres; freestyle_scene->r.color_mgt_flag = 0; // old_scene->r.color_mgt_flag; - freestyle_scene->r.scemode = old_scene->r.scemode & ~(R_SINGLE_LAYER | R_NO_FRAME_UPDATE | R_MULTIVIEW); + freestyle_scene->r.scemode = old_scene->r.scemode & ~(R_SINGLE_LAYER | R_NO_FRAME_UPDATE | R_MULTIVIEW) & + (re->r.scemode | ~R_FULL_SAMPLE); freestyle_scene->r.flag = old_scene->r.flag; freestyle_scene->r.threads = old_scene->r.threads; freestyle_scene->r.border.xmin = old_scene->r.border.xmin; ```
Author
Member

Added subscriber: @IRIEShinsuke

Added subscriber: @IRIEShinsuke
Tamito Kajiyama was assigned by Shinsuke Irie 2018-11-02 11:49:01 +01:00
Author
Member

Added subscriber: @brecht

Added subscriber: @brecht

This issue was referenced by b98f76cd90

This issue was referenced by b98f76cd90a14d500fb9a059b95aa32c3ab9e6e4

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#57388
No description provided.