Gamma-correct bilinear filtering as an option

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Gamma-correct bilinear filtering as an option

Re: Gamma-correct bilinear filtering as an option

by Darkcrafter » Sat Jul 23, 2022 1:52 pm

Am I the only who prefers the way GZDoom does it better? Look at those huge awful red squares scattered over blue mess, the old way they're much thinner fireflies. I also obtained an LOC IPS monitor which I got rid off after a week of having and replaced it over old TS matrix one just because it seemed to me that I actually don't like the detalisation and color saturation it provides, especially in Doom that starts looking so brownish.

Re: Gamma-correct bilinear filtering as an option

by Graf Zahl » Sun Jun 05, 2022 2:25 pm

That settles it. I fail to see the appeal if you need the ugliest texture in all of Doom to demonstrate the difference. Personally I never perceived the filtering as-is as incorrect.

Re: Gamma-correct bilinear filtering as an option

by dpJudas » Sun Jun 05, 2022 2:06 pm

There is no real difference here between OpenGL and Vulkan. In both cases it involves setting the texture format to sRGB so that the linear sampling filter will interpolate correctly. Unfortunately that then creates a linear output. The easiest way to deal with that would be to then reapply the sRGB gamma right after the texture(tex, pos) call in the GLSL code.

If Doom was a modern game with complex modern lights this might be worth it. For Doom? It would make it run worse on lower end hardware for a very minor visual improvement for higher end. I'd say it isn't worth it. In any case, I won't try do it because I'm in the nearest filtering camp anyway. ;)

Re: Gamma-correct bilinear filtering as an option

by Rachael » Sun Jun 05, 2022 10:00 am

The last thing we need to do is increase the complexity of the renderer when an option is available that provides more of a correct render for all elements rather than just the textures themselves. Putting in a change for just the textures would introduce an unnecessary complexity that would interfere with a better and more comprehensive solution which if implemented would solve this issue anyhow.

Re: Gamma-correct bilinear filtering as an option

by axredneck » Sun Jun 05, 2022 9:50 am

Rachael wrote:In order to do this correctly the entire scene would have to be rendered in a (2.2) gamma and then render it back with a (1.0/2.2) gamma in post. I don't think there is any other way to do this to get the desired result.
Doesn't Vulkan have some better way of doing it?

Re: Gamma-correct bilinear filtering as an option

by axredneck » Sun Jun 05, 2022 9:45 am

Graf Zahl wrote:That's a bad texture for demonstration.
Yes, most textures look OK-ish. I showed this texture on purpose as extreme case among actual Doom textures.

Re: Gamma-correct bilinear filtering as an option

by Graf Zahl » Sat Jun 04, 2022 11:38 pm

That's a bad texture for demonstration.

In any case, you'll need someone with better technical knowledge of how to implement it. It seems to involve a major rework of the entire renderer. I'm not going to do this myself.

Re: Gamma-correct bilinear filtering as an option

by Rachael » Sat Jun 04, 2022 10:12 pm

Yes - it makes linear filtering a lot more tolerable.

Re: Gamma-correct bilinear filtering as an option

by Nash » Sat Jun 04, 2022 9:52 pm

The color difference demonstrated in the OP is even more obvious on this IPS monitor I'm using. I didn't even realize this was a thing before this. :O

The bottom one looks much more pleasing to the eyes, too.

Re: Gamma-correct bilinear filtering as an option

by Chris » Sat Jun 04, 2022 9:05 pm

Having a gamma-correct rendering pipeline would be nice, especially for PBR stuff for more accurate lighting. But yeah, all currently available content is expecting sRGB rendering/blending so there'd have to be some method to opt-in to it when the content can expect it, probably at a game level.

Re: Gamma-correct bilinear filtering as an option

by Rachael » Sat Jun 04, 2022 6:18 pm

In order to do this correctly the entire scene would have to be rendered in a (2.2) gamma and then render it back with a (1.0/2.2) gamma in post. I don't think there is any other way to do this to get the desired result.

Then dynamic lights would have to be adjusted to fade with the new gamma ramp. Not even sure how fog will work.

Gamma-correct bilinear filtering as an option

by axredneck » Sat Jun 04, 2022 6:02 pm

That's how GZDoom and old games do bilinear filtering:
W65B_2-old.png
W65B_2-old.png (152.18 KiB) Viewed 1485 times
That's how FTEQW, GIMP, Blender and modern game engines do it:
W65B_2-correct.png
W65B_2-correct.png (163.3 KiB) Viewed 1485 times
It's especially noticeable on motley (e.g. heavily dithered) textures.

Top