LuxCoreRender / LuxCore

LuxCore source repository
Apache License 2.0
1.16k stars 146 forks source link

Feature Request: Sinc and Catmull-Rom Pixel Filters #415

Closed rrubberr closed 4 years ago

rrubberr commented 4 years ago

Request

In Luxrender, there were certain filters present which are notably absent in LuxCoreRender, including the Sinc and Catmull-Rom pixel filters. Although the Catmull-Rom filter can be considered "visually similar" to those already implemented in LuxCore, these filters give unique results which are not possible through simple post-process sharpening.

I have created a number of examples to demonstrate these differences:

Group1 Group2 Group3 Group4 Group5 Group6

Each image was rendered for two hours with a resolution of 4704x3136, with a filter width of 2.0, then was exported as 32 bit EXR data and tonemapped with consistent settings in Photoshop. The Gaussian image was allowed to fully converge, and is provided as a reference.

As you can see, the Sinc filter presents the sharpest result, and resolves detail which the others do not, including fine detail on the playing cards and the nyquist frequency chart, while it also presents the sharpest result on the colored Siemens star charts. The minute text on the paint tubes is also legible, and text appears clearest overall with this filter.

Implementation

These filters were implemented in LuxRender based on the following:

LuxRender implementation of Catmull-Rom: https://web.archive.org/web/20131231050109/http://www.luxrender.net/forum/viewtopic.php?f=8&t=10381

Windowed Sinc Filter (presumably what the LuxRender implementation was based on): http://www.pbr-book.org/3ed-2018/Sampling_and_Reconstruction/Image_Reconstruction.html#x1-WindowedSincFilter

Summary

While these may seem extraneous in the context of LuxCore, at the very least, the Sinc filter produces a result which is distinct from the currently available filters, and would be an appreciated addition. Further, most users stick with the default Blackman-Harris filter and do not change the pixel filter setting, so they will not be bothered or confused by the addition of another filter.

Full-Size JPEGs of the scene I created to test Sinc and Catmull-Rom filter sharpness are included for reference:

Sinc

Sinc

Catmull-Rom

Catmull-Rom

Dade916 commented 4 years ago

It is so simple to add a pixel filter that it would take more time to argue of their practical use than just add them. I have added the support for SINC and CATMULLROM pixel filters in v2.5 sources.

@Theverat, the properties are:

film.filter.type = SINC
# Width/height like all other pixel filters
# The default value in old Lux was 3 but it is to prone to aliasing problems so I picked 1
film.filter.sinc.tau = 1

# Or

film.filter.type = CATMULLROM
# Width/height like all other pixel filters
# No additional parameters
Theverat commented 4 years ago

It is so simple to add a pixel filter that it would take more time to argue of their practical use than just add them.

Well, don't forget that they need to be added in the addon, in the documentation and in the SDL manual (if we want to be precise).

film.filter.sinc.tau = 1

What are useful min and max values for this property? I always need these.

Dade916 commented 4 years ago

film.filter.sinc.tau = 1

What are useful min and max values for this property? I always need these.

Something like ]0.0, 8.0].