Any way to get rid of bilinear filtering?

Use this forum for general user support and related questions.
Post Reply
AutogolazzoJr
Posts: 6
Joined: Sun May 06, 2018 10:10 pm

Any way to get rid of bilinear filtering?

Post by AutogolazzoJr » Fri Apr 26, 2019 10:53 pm

This is literally the bane of any low-resolution-texture aficionado. Any way to turn it off?
https://i.imgur.com/b8UjOr1.png

User avatar
alpistinho
Developer
Developer
Posts: 148
Joined: Thu Jul 05, 2018 11:38 pm
Location: Rio de Janeiro

Re: Any way to get rid of bilinear filtering?

Post by alpistinho » Fri Apr 26, 2019 11:27 pm

Not currently, bilinear is always used.
Dade wrote:
Wed May 09, 2018 9:15 am
happysmash27 wrote:
Wed May 09, 2018 3:23 am
I am trying to change the interpolation of an image texture to be nearest neighbour, with sharper, cleaner lines. However, I don't see an interpolation option. Is it currently possible to do this without manually making the texture larger?
Not at the moment, bilinear interpolation is always used. Indeed, it would be quite easy to add as an option but it has never be done until now.
Where is that located in the code?

PS: Dade, were you notified of this quote?
Support LuxCoreRender project with salts and bounties

AutogolazzoJr
Posts: 6
Joined: Sun May 06, 2018 10:10 pm

Re: Any way to get rid of bilinear filtering?

Post by AutogolazzoJr » Sat Apr 27, 2019 1:27 am

I've seen that post. I think no interpolation really needs to be added as an option. For now, the only way to get blocky pixels is to pre-scale the textures.

User avatar
Dade
Developer
Developer
Posts: 2807
Joined: Mon Dec 04, 2017 8:36 pm

Re: Any way to get rid of bilinear filtering?

Post by Dade » Sat Apr 27, 2019 12:43 pm

alpistinho wrote:
Fri Apr 26, 2019 11:27 pm
Where is that located in the code?
The code for image maps bi-linear interpolation is here: https://github.com/LuxCoreRender/LuxCor ... p.cpp#L345

But, as usual, the hard part is not the C++ code but the OpenCL one.
Support LuxCoreRender project with salts and bounties

happysmash27
Posts: 20
Joined: Sun May 06, 2018 2:36 am

Re: Any way to get rid of bilinear filtering?

Post by happysmash27 » Mon Jun 17, 2019 8:57 pm

Can someone, perhaps, explain what, exactly, it is doing? I don't quite understand the inputs and outputs, and it doesn't help that I am more familiar with C than C++.

User avatar
B.Y.O.B.
Developer
Developer
Posts: 2809
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Any way to get rid of bilinear filtering?

Post by B.Y.O.B. » Mon Jun 17, 2019 9:18 pm

It maps UV coordinates to 4 texels in the image texture and performs bilinear filtering on those 4 texels.
It returns the resulting color (basically a weighted mix between the 4 texels).
See https://en.wikipedia.org/wiki/Bilinear_filtering

I think if you want to implement a method without bilinear filtering, you would just evaluate one texel at the UV location and return its color.
Support LuxCoreRender project with salts and bounties

Post Reply