Border Render - LuxRender Wiki
Luxrender GPL Physically Based Renderer

Border Render

Personal tools

From LuxRender Wiki

Jump to: navigation, search


Border Render

What it is

Border rendering is the act of rendering a smaller subset of a larger render. It is typically used to further render an area of an image that is taking longer to clear up than the rest of the image. Or for previewing a part of your scene. The images are then combined in an image editing program such as Gimp/Photoshop/MSPaint.

What it is not

It is not a way to add more samples to a film file in only one area.

Border Rendering from Blender

From within Blender switch to camera view, press Shift+b, then drag the cross-hairs to highlight the area you want re-rendered. Then render as normal, but be sure to render with a different file name.

Border Rendering for the Blender impaired

If you do not have a modeling program with a border render feature, you can still do a border render. Border renders are controlled by the xresolution, yresolution, and the "screenwindow" setting.

Screenwindow setting

The screenwindow setting is the starting and ending points of the viewable rectangle, and is directly related to the image ratio 0.0, 0.0 is the center of the image, the image goes from left to right (-1.0 to +1.0) in the x axis and from bottom to top (-ratio to +ratio) in the y axis.

Example: For a 1000x600 image the ratio is 0.6 (600/1000). So the screenwindow setting is:
"float screenwindow" [-1.000000 1.000000 -1.000000 1.000000].


Example 1

To render the bottom right quadrant of an image that is 700x700 the following settings would be used.

"float screenwindow" [0.0 1.0 -1.0 0.0]
"integer xresolution" [350]
"integer yresolution" [350]

Example 2

Lets pretend that the Luxrender logo and text from the luxball scene is taking much longer to clear up than the rest of the scene. To clean up just the luxrender logo and text I used a 229x105 section of the 700x700 image starting at 295x512, the following settings were used.

"float screenwindow" [-0.157142857142857 0.497142857142857 -0.762857142857143 -0.462857142857143]
"integer xresolution" [229]
"integer yresolution" [105]

The Math

The math for this is pretty crazy, so bear with me. The following will use example 2.

For the screenwindow setting we start with the first coordinate.
The first coord is the negative of half the x resolution plus the x starting position divided by the negative of half the x resolution.
-350 + 295 = -55
-55/-350 = -0.15714285714286

The second coord in the screenwindow setting is the end point in the x direction.
We get this by adding the start point with the x resolution of the border render divided by half the x resolution.
-55 + 229 = 174
174 / 350 = 0.49714285714286

The third coord in the screenwindow setting is the starting point of the y direction, the tricky part is that it starts at the bottom with the negative of the ratio of y/x.
We get this number by adding the negative of half the y resolution with the border top starting position divided by half the y resolution.
(-350 + 105) + 512 = 267
267 / 350 = -0.76285714285714

The final coord in the screenwindow setting is the ending point of the y resolution, which is at the top.
We get this number by adding the negative of the top offset plus half of the y resolution divided by half of the y resolution.
-512 + 350 = -162
-162 / 350 = -0.46285714285714

The Results

  • Pre border render
    Border render pre.jpg
  • Post border render
    Border render post.jpg

The Spreadsheet