Changing the 'Render Region' when rendering with Python with 'Persistent Images' checked results in glitched renders #71004

Open
opened 2019-10-21 21:43:23 +02:00 by Ray Mairlot · 4 comments

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.30

Blender Version
Broken: version: 2.82 (sub 1), branch: master, commit date: 2019-10-21 13:53, hash: 200267eb96
Worked: -

Short description of error

I have a (simplified) script that moves to a specific frame, sets the render region to a specific position and renders, before repeating the process for the next frame with a new render region position. When the 'Persistent Images' option in Render> Performance> Final Render is on, some of the resulting renders are glitched (they open but have artifacts) and the objects do not seem to be in the correct position.

Turning off 'Persistent Images' results in renders with the objects in the expected location and without artifacts.

For some context, I do not specifically want to have 'Persistent Images' on; I have an add-on which repositions the render border on a per-frame basis and a user reported glitching renders.

Frame 8 - Persistent Images off- Correct location in render

Persistant Images off - frame 0008.png

Frame 8 - Persistent Images on- Incorrect location in render and artifacts

Persistant Images on - frame 0008.png

Frame 7 - Persistent Images off- Correct location in render

Persistant Images off - frame 0007.png

Frame 7 - Persistent Images on- Incorrect location in render

Persistant Images on - frame 0007.png

Exact steps for others to reproduce the error

Render Region + Persistent Images bug.blend

  1. Open the attached blend file and set an output directory for the render.
  2. Press 'Run Script' in the open text editor to render out the images.

Images 3, 7, 8 and 9 will probably have artifacts and for the other frames the objects will be in the incorrect location (the border should be positioned perfectly around them).

Note: I have set the script to render 10 frames because it seems to depend on what was rendered previously as to whether the glitches/incorrect positions will appear. Rendering the glitched frames on their own does not produce the errors consistently.

**System Information** Operating system: Windows-10-10.0.18362 64 Bits Graphics card: GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 436.30 **Blender Version** Broken: version: 2.82 (sub 1), branch: master, commit date: 2019-10-21 13:53, hash: `200267eb96` Worked: - **Short description of error** I have a (simplified) script that moves to a specific frame, sets the render region to a specific position and renders, before repeating the process for the next frame with a new render region position. When the 'Persistent Images' option in *Render> Performance> Final Render* is on, some of the resulting renders are glitched (they open but have artifacts) and the objects do not seem to be in the correct position. Turning off 'Persistent Images' results in renders with the objects in the expected location and without artifacts. For some context, I do not specifically *want* to have 'Persistent Images' on; I have an add-on which repositions the render border on a per-frame basis and a user reported glitching renders. **Frame 8** - Persistent Images **off**- Correct location in render ![Persistant Images off - frame 0008.png](https://archive.blender.org/developer/F7844561/Persistant_Images_off_-_frame_0008.png) **Frame 8** - Persistent Images **on**- Incorrect location in render and artifacts ![Persistant Images on - frame 0008.png](https://archive.blender.org/developer/F7844563/Persistant_Images_on_-_frame_0008.png) **Frame 7** - Persistent Images **off**- Correct location in render ![Persistant Images off - frame 0007.png](https://archive.blender.org/developer/F7844560/Persistant_Images_off_-_frame_0007.png) **Frame 7** - Persistent Images **on**- Incorrect location in render ![Persistant Images on - frame 0007.png](https://archive.blender.org/developer/F7844562/Persistant_Images_on_-_frame_0007.png) **Exact steps for others to reproduce the error** [Render Region + Persistent Images bug.blend](https://archive.blender.org/developer/F7844634/Render_Region___Persistent_Images_bug.blend) 1. Open the attached blend file and set an output directory for the render. 2. Press 'Run Script' in the open text editor to render out the images. Images 3, 7, 8 and 9 will probably have artifacts and for the other frames the objects will be in the incorrect location (the border should be positioned perfectly around them). **Note**: I have set the script to render 10 frames because it seems to depend on what was rendered previously as to whether the glitches/incorrect positions will appear. Rendering the glitched frames on their own does not produce the errors consistently.
Author

Added subscriber: @RayMairlot

Added subscriber: @RayMairlot
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm this results in glitchy renders.

Without digging in the internals of Persistent Images I would assume these will not play nice with border rendering plus the border actually changing...

I think we could check on this (possibly using BufferParams::modified()? or something similar? Or just checking if the camera borders are still the same when syncing the camera?) on turn OFF Persistent Images in that case...
Not sure where this should take place though, there is one case where this gets done for OSL in BlenderSync::get_scene_params()
Another similar one in BlenderSession::reset_session where the sessions gets freed/recreated when params changed, see this comment

/* if scene or session parameters changed, it's easier to simply re-create
 * them rather than trying to distinguish which settings need to be updated
 */
Can confirm this results in glitchy renders. Without digging in the internals of `Persistent Images` I would assume these will not play nice with border rendering plus the border actually changing... I think we could check on this (possibly using BufferParams::modified()? or something similar? Or just checking if the camera borders are still the same when syncing the camera?) on turn OFF `Persistent Images` in that case... Not sure where this should take place though, there is one case where this gets done for OSL in `BlenderSync::get_scene_params() ` Another similar one in `BlenderSession::reset_session` where the sessions gets freed/recreated when params changed, see this comment > /* if scene or session parameters changed, it's easier to simply re-create > * them rather than trying to distinguish which settings need to be updated > */
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 13:59:30 +01:00
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
2 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#71004
No description provided.