prman-pixar / RenderManForBlender

RenderMan for Blender render addon
MIT License
804 stars 134 forks source link

Overscan Rendering #564

Closed earlywill closed 1 year ago

earlywill commented 6 years ago

I've done a first pass at implementing overscan rendering, which allows you to add extra pixels to the render outside the display window. For example, a setting of 100x100px adds 50px to each side of the image.

overscan_options

This is useful if you want a little bit of safety to reframe the image in post, avoid blurring issues near image borders or you need to do some lens distortion.

overscan

Currently it works like this...

  1. Set the ScreenWindow and Resolution in the RIB file to the new image area (this doesn't modify the FOV)
  2. Runs oiiotool on the renders at the end of the job to set the DisplayWindow back to it's intended format so the view looks correct against your Blender viewport. As a bonus this autocrops the render based on the alpha.

There is one big glaring issue with this that will affect how this is implemented and that's the second point.

I'm currently using oiiotool to set the DisplayWindow as there isn't an existing Renderman tool to do this. Oiiotool is an external tool and would require the user to have it in their PATH. Without this the user would need to reformat the images manually using something like a Reformat node in Nuke - which might not be obvious how to do this. I can add an option "post convert using oiiotool".

Does anyone have any thoughts about this?

adminradio commented 6 years ago

I like the idea and see the need for post production, especially for blurring. The option for resetting the display window back should only be available if 'oiiotool' where found. If not, the user should know what somebody had enabled and have to deal with it.

I'm not fully satisfied with the terms 'width' and 'height' because they have to be recalculated by brain, I would name them something like "Vertical Overscan: 50px" and "Horizontal Overscan: 50px" which describes exactly whats going on: overscanning a single border by 50px. But this is my own point of view and may be biased.

From the fellows of printing post production comes the term bleed, which describes the overprinting for cutting the sheet. Typically they are given for any single border (like CSS-Border-Attributes), but mostly used with a single value which is applicable for all four side. I like the wording bleed a lot, but didn't know if that would fit here.

earlywill commented 6 years ago

Thanks, that's great feedback. It's actually easier to not include the postconvert using oiiotool, currently trying to figure out all the displays that get written out and process isn't obvious. Maybe need to think about oiiotool postconvert as another separate feature (optional add-on 😊), this come from the way I work - with local queue I post convert exr to dpx and then convert those to prores using ffpeg for editing in resolve while comp with the exrs.

Point of overscan width/height is good, more obvious what it's doing. In Katana they offer control over each side, but dealing with lopsided overscan can be tricky which is why I didn't go that option. Bleed could also be used to describe this (especially for print), overscan is a bit more common term in vfx - both katana and nuke use it.

adminradio commented 6 years ago

Naming it "overscan" is absolutely fine, even if I came from the printing world I understand immediately what you wanted to do.

I would keep in mind, that the user could have enabled percentage scaling under Dimensions and you have to make clear how do you handle this. Since this is an option for generating final images (in my humble opinion) and percentage scaling is mostly enabled during prerendering, a boolean option for toggle overscanning like the following would do the trick:

[x] Full size render only

Should be enabled by default because it impacts render times a lot and a good description for the property should mention something about "100%", "Dimensions" or so. :-)

You can get the percentage scaling of the current scene with:

bpy.data.scenes[bpy.context.scene.name].render.resolution_percentage

This will return 100 if a full size rendering is requested.

earlywill commented 6 years ago

I did a lot of my testing at 25%, so I know what you mean (adding 512px to an HD@25% image ends up doubling the intended resolution :) ). I'm thinking the following drop-down.

adminradio commented 6 years ago

Even better. Perfect. :)