Advertisement

what’s the best way to upScale the left pic to the right one, whether denoise or AA, thanks!

Started by July 20, 2024 11:09 AM
5 comments, last by JoeJ 1 month, 2 weeks ago

what’s the best way to upScale the left pic to the right one, whether denoise or AA, thanks!

I would try a cubic texture filter, which is smooth and does not show the discontinuities of a standard linear filter.

Some mobile GPUs have it in hardware, but usually you need to emulate it using 4 linear fetches. On CPU i do it using a 3x3 kernel, while linear is just 2x2.

Some shadertoy i've found: BiCubic Sample (shadertoy.com)

Not sure if the link works, but there are many examples.
It won't bring back fine details out of nowhere, but it's truly smooth which is often good enough.

Advertisement

JoeJ said:
Some mobile GPUs have it in hardware, but usually you need to emulate it using 4 linear fetches.

would you please show more details about this?:P or what keywords should i google?such as arm cubic filter?qualcomm cubic filter?powervr cubic filter?is it able to directly use it?need some specific extention?

Thanks!

gpu said:
would you please show more details about this?:P or what keywords should i google?such as arm cubic filter?qualcomm cubic filter?powervr cubic filter?is it able to directly use it?need some specific extention?

It's not easy to find, it seems.
I found a Vulkan extension called VK_EXT_filter_cubic, but not sure if it also exists for OpenGL.

The devices which support it are all Qualcomm: https://vulkan.gpuinfo.org/listdevicescoverage.php?extension=VK_EXT_filter_cubic&platform=all

@JoeJ thanks! so how to do it in GLES, set mag/min_filter to nearest, then so the cubic filter in shader?

gpu said:
set mag/min_filter to nearest

No, use the standard bilinear filter, then combine 4 bilinear samples as shown by the shadertoy.

Just found another one, which does a approximation with only one sample, probably using some trick to modulate uv so the linear curve becomes something like smoothstep:

https://www.shadertoy.com/view/wtByDt

Reminds me on this article: https://iquilezles.org/articles/texture/

This topic is closed to new replies.

Advertisement