Click on render-in-progress to choose tile priority area
OpenPublic

Description
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. :)
ldo created this task. · Oct 27 2013, 5:32 AM
ldo set Type to Patch.
ldo attached a file: F23833: tile-prio.patch
tile-prio-20131103.patch: resubmission to keep up with changes in source tree.
dingto added subscribers: brecht, dingto.Via Web · Nov 15 2013, 4:59 AM

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

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

brecht added a comment.Via Web · Nov 15 2013, 4:31 PM

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/

ldo added a comment.Via Web · Nov 16 2013, 11:38 PM

Demo video here.

DarthFugu added a subscriber: DarthFugu.Via Web · Dec 10 2013, 11:37 AM

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

dingto added a comment.Via Web · Dec 10 2013, 11:53 AM

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

DarthFugu added a comment.Via Web · Dec 10 2013, 12:52 PM

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 added a comment.Via Web · Dec 10 2013, 10:19 PM

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.

brecht added a comment.Via Web · Dec 10 2013, 11:35 PM

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

Add Comment