Click on render-in-progress to choose tile priority area #37220

Closed
opened 2013-10-27 05:32:46 +01:00 by Lawrence D'Oliveiro · 19 comments

%%%The enclosed patch implements a feature whereby the user can click anywhere in the render result display while a render is in progress, to tell the renderer to preferentially choose subsequent tiles near the clicked point.

Sometimes during a lengthy render, you want to specifically see how a particular part of the image is turning out. Currently you have to wait for the tile rendering sequence to work its way out from the centre until it gets to the location of interest. With this patch you can simply click to quickly move the tiling sequence to another point. All the tiles still get rendered, of course, just in a different, user-selectable order.

Overview: previously the threaded_tile_processor routine (pipeline.c) would queue up all the tiles in the workqueue before starting the render threads. Now it queues up just a minimum of tiles to try to ensure the queue will not prematurely empty, and the rest get added one by one as each previously-queued tile completes. This way it can respond to mouse clicks which alter the priority for choosing subsequent unprocessed tiles.

I had to make a couple of API changes to get this to work: add a new routine RE_SetPreferTile to RE_pipeline.h/pipeline.c, and change internal routine wm_job_find (in wm_jobs.c) to exported routine WM_job_find. Also I had to use a more roundabout way than I would like to find the image display region in screen_render_modal, because the obvious CTX_wm_region call kept returning NULL (at least most of the time).

If there is a cleaner way of doing what I’m doing here, please advise, and I will resubmit.

This currently only works for Blender Internal; if all goes well, I might look at how to do it for Cycles. :)%%%

%%%The enclosed patch implements a feature whereby the user can click anywhere in the render result display while a render is in progress, to tell the renderer to preferentially choose subsequent tiles near the clicked point. Sometimes during a lengthy render, you want to specifically see how a particular part of the image is turning out. Currently you have to wait for the tile rendering sequence to work its way out from the centre until it gets to the location of interest. With this patch you can simply click to quickly move the tiling sequence to another point. All the tiles still get rendered, of course, just in a different, user-selectable order. Overview: previously the threaded_tile_processor routine (pipeline.c) would queue up all the tiles in the workqueue before starting the render threads. Now it queues up just a minimum of tiles to try to ensure the queue will not prematurely empty, and the rest get added one by one as each previously-queued tile completes. This way it can respond to mouse clicks which alter the priority for choosing subsequent unprocessed tiles. I had to make a couple of API changes to get this to work: add a new routine RE_SetPreferTile to RE_pipeline.h/pipeline.c, and change internal routine wm_job_find (in wm_jobs.c) to exported routine WM_job_find. Also I had to use a more roundabout way than I would like to find the image display region in screen_render_modal, because the obvious CTX_wm_region call kept returning NULL (at least most of the time). If there is a cleaner way of doing what I’m doing here, please advise, and I will resubmit. This currently only works for Blender Internal; if all goes well, I might look at how to do it for Cycles. :)%%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%tile-prio-20131103.patch: resubmission to keep up with changes in source tree.%%%

%%%tile-prio-20131103.patch: resubmission to keep up with changes in source tree.%%%

Added subscribers: @brecht, @ThomasDinges

Added subscribers: @brecht, @ThomasDinges

This looks nice and would be cool for Cycles as well.

Brecht, could you take a look at the patch please? :)

This looks nice and would be cool for Cycles as well. Brecht, could you take a look at the patch please? :)

The functionality is ok, but I will need to look into this more closely.

The code is formatted quite inconsistent, please follow the same style as surrounding code or read this:
http://wiki.blender.org/index.php/Dev:Doc/Code_Style

When that's done, could you submit the diff here? It's hopefully going to be more efficient to do code reviews that way.
http://developer.blender.org/differential/diff/create/

The functionality is ok, but I will need to look into this more closely. The code is formatted quite inconsistent, please follow the same style as surrounding code or read this: http://wiki.blender.org/index.php/Dev:Doc/Code_Style When that's done, could you submit the diff here? It's hopefully going to be more efficient to do code reviews that way. http://developer.blender.org/differential/diff/create/

Demo video here .

Demo video [here ](https://vimeo.com/79161807).
DarthFugu commented 2013-12-10 11:37:22 +01:00 (Migrated from localhost:3001)

Added subscriber: @DarthFugu

Added subscriber: @DarthFugu
DarthFugu commented 2013-12-10 11:37:22 +01:00 (Migrated from localhost:3001)

Could you guide me how to install/run this in Blender? I don't have a clue how to do it.

Could you guide me how to install/run this in Blender? I don't have a clue how to do it.

This is a patch, you need to apply it to the source code and compile it.

This is a patch, you need to apply it to the source code and compile it.
DarthFugu commented 2013-12-10 12:52:54 +01:00 (Migrated from localhost:3001)

Thats what i mean i've got no idea how to do that i have only installed .py scripts and don't have a clue how to do what you said, thanks for fast reply :D

Thats what i mean i've got no idea how to do that i have only installed .py scripts and don't have a clue how to do what you said, thanks for fast reply :D
DarthFugu commented 2013-12-10 22:19:00 +01:00 (Migrated from localhost:3001)

Could you show me some step by step tutorial or something because i've searched how to apply patch to source code, but i didn't even understand how to start the source or even send me a blender version with the patch applied already.

Could you show me some step by step tutorial or something because i've searched how to apply patch to source code, but i didn't even understand how to start the source or even send me a blender version with the patch applied already.

There isn't really a simple step by step tutorial that we could give, building Blender is fairly complicated if you're not familiar with that kind of thing. See here for how to download the source and compile:
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender

For applying patches there is some info here:
http://wiki.blender.org/index.php/Dev:Doc/Tools/Patches#Applying_Patches

There isn't really a simple step by step tutorial that we could give, building Blender is fairly complicated if you're not familiar with that kind of thing. See here for how to download the source and compile: http://wiki.blender.org/index.php/Dev:Doc/Building_Blender For applying patches there is some info here: http://wiki.blender.org/index.php/Dev:Doc/Tools/Patches#Applying_Patches

Added subscriber: @g-lul

Added subscriber: @g-lul

I must say I am disappointed with the quality of review for this patch. It turns out the functionality is not “ok”, because the calculation of the click point will be thrown off by the width and height of windows to the left and below the image editor window. You can even notice this to some extent in the demo video. And yet it seems the main complaint I get is about the formatting style.

Enclosed tile-prio-20140830.patch is a reworking of the patch to fix this problem by doing the click calculation in a different way. Unfortunately this has its own drawback, which is that responding to the clicks cannot happen until the render actually starts. Which defeats a lot of the point of the patch.

I must say I am disappointed with the quality of review for this patch. It turns out the functionality is **not** “ok”, because the calculation of the click point will be thrown off by the width and height of windows to the left and below the image editor window. You can even notice this to some extent in the demo video. And yet it seems the main complaint I get is about the formatting style. Enclosed [tile-prio-20140830.patch](https://archive.blender.org/developer/F107368/tile-prio-20140830.patch) is a reworking of the patch to fix this problem by doing the click calculation in a different way. Unfortunately this has its own drawback, which is that responding to the clicks cannot happen until the render actually starts. Which defeats a lot of the point of the patch.

Added subscriber: @Sergey

Added subscriber: @Sergey

Not really happy with the code from the latest patch:

  • it seems to contain unrelated changes. which makes checking on actual changes more tricky
  • Don't really think it should be the same operator as render one, would think separate operator to define POI which you can invoke before render is more handy
  • Acquiring imbuf is probably not needed, we've got an utility function to convert mouse coordinate to the region space (which would give you normalized 0..1 coordinates in this case)
  • You shouldn't look up for region manually, it it's NULL from the context it might happen something which is not expected to or you're not using something in the way it was expected to
  • Would be nice to have it generalized so all render engines can benefit from this
Not really happy with the code from the latest patch: - it seems to contain unrelated changes. which makes checking on actual changes more tricky - Don't really think it should be the same operator as render one, would think separate operator to define POI which you can invoke before render is more handy - Acquiring imbuf is probably not needed, we've got an utility function to convert mouse coordinate to the region space (which would give you normalized 0..1 coordinates in this case) - You shouldn't look up for region manually, it it's NULL from the context it might happen something which is not expected to or you're not using something in the way it was expected to - Would be nice to have it generalized so all render engines can benefit from this

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2015-05-22 11:56:23 +02:00

No news here since months… archiving for now, we can always reopen should the raised points be addressed.

No news here since months… archiving for now, we can always reopen should the raised points be addressed.
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
7 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#37220
No description provided.