Reframe (Compatible with IFFS 2024.1.0 and up)
This Matchbox shader reframes a shot with respect to perspective distortion.
The concept of this shader is to simulate a different focal length and camera orientation while maintaining the camera position.
Image-wise only transformations are applied to acquire alternate view frames, thus brightness is retained and bokeh is transformed with the image (note that this can lead to deformed bokeh when extremely wide source FoV and strong off-centreing come together).
The
The resulting image format can be customized to any canvas resolution, including but not limited to Flame
Since the combined transformations per pixel are well-behaved over the resulting frame (for typical use), an intermediate pass containing the UV coordinates is calculated. The final pass transforming the image itself then uses those UVs, which is where the antialiasing is also applied (for performance reasons). Note that this can cause a loss of information for the very border pixels that would ideally interpolate from antialiasing sample locations outside the frame too.
To eliminate this error, one can specify a canvas resolution exactly 2 pixels wider & higher to then crop it back to the desired format using the <Resize & Crop> node.
Note that Flame may automatically & forcefully snap to the closest
Upressing is best done with other means than this shader. Significant enlargements of small image viewports to a canvas of the same resolution as the input also might result in strong pixelation.
If need be, one can output the intermediate (continuous) UV coordinates and feed them into an external filter better suited towards upressing. Note that when outputting UV coordinates, the Matte result is intentionally black to incentivize running it too through the external filter.
The shader correctly handles conversions between all source and result formats, no matter the image- and pixel aspect ratios. In cases of deviating image aspect ratios, the width of the virtual result is matched according to the relative image height (which is retained from the source).
Adaptive Degradation is supported by this shader, which conditionally bypasses antialiasing.
This shader is licensed under the terms of the MIT license.
For questions contact:
nobbl211 _at_ gmail.com
Version notes
relaxed version requirement of GLSL to 130
Older versions that shader
24th of August 2023
Downloadfixed an error that could lead to incorrect emulation of perspective for some configurations of source & target FoV bases
rotation is now applied before the change of perspective
introduced scaling correction for image rectification
added rotation compensation on transformation
added a control for the antialiasing softness
added controls for result pixel aspect ratio override
reworked interface to make proper use of the 6- and 3 column layouts
tweaked default values & increments of certain controls to enhance user experience
improved accuracy of antialiasing sample accumulation through algebraic and geometric summation optimizations
significantly sped up shader compile time
massively improved antialiasing performance
fixed shader thumbnail
minor changes & fixes
21th of August 2023
DownloadImproved consistency of the distortion correction and minor changes & fixes
comments powered by Disqus