# How to resolve the Z pass when rendering with subframes?

Currently I'm trying to render my scenes by making use of subframes to save on rendertimes through rendering on multiple nodes.

But when I do this I'm having problems combining the chuncks from the Z pass. As you can see in the combined image below the Z pass does not show correctly. It seems to reset the nearest and farest point of each individual subframe.

How should I go about fixing this? I'm all out of ideas.
Any help would be greatly appreciated!

Combined Z pass chuncks:

Example of the python script I'm using:

cat >subframe.py <<EOF
import bpy
bpy.context.scene.render.border_min_x = $SF_MIN_X bpy.context.scene.render.border_max_x =$SF_MAX_X
bpy.context.scene.render.border_min_y = $SF_MIN_Y bpy.context.scene.render.border_max_y =$SF_MAX_Y
bpy.context.scene.render.use_border = True

scene.node_tree.nodes['File Output'].base_path = '$OUTDIR' for file_slot in scene.node_tree.nodes['File Output'].file_slots: file_slot.path=file_slot.path + '_X-' + str($SF_MIN_X) + '-' + str($SF_MAX_X) + '-Y-' + str($SF_MIN_Y) + '-' + str($SF_MAX_Y) bpy.app.handlers.render_pre.append(add_subframe_to_fo_path) EOF blender -b *.blend -P subframe.py -F PNG -o$OUTDIR/frame_######_X-$SF_MIN_X-$SF_MAX_X-Y-$SF_MIN_Y-$SF_MAX_Y -s $START -e$END -j \$STEP -t 0 -a


Node setup:

Hardware/software specifications:

Blender version nr: 2.78a
Render engine: Cycles
OS: Linux Ubuntu

• The first question is why are you normalizing? If you must normalize then normalize the combined image not parts with different ranges. Use the EXR fomat for saving your images so that you can keep the z values unaltered and linear. – cegaton Apr 7 '17 at 16:56
• @cegaton I'm normalizing because I want to use the output image as a custom mist effect to overlay on my renderlayers. and also to use as a lens blur alpha in photoshop. Leaving out the normalize node seems to resolve the issue I'm having. But now however I'm not able to stitch the EXRs – Delagone Apr 10 '17 at 11:41