CrossVR / hqx-shader

GPU shader version of HQx filter
GNU Lesser General Public License v2.1
47 stars 9 forks source link

Unexpected HQX results, possibly from the LUT texture #1

Closed altmoola closed 9 years ago

altmoola commented 9 years ago

I am getting this result after implementing the HQX filter in a MonoGame solution:

Actual

I think it has something to do with the LUT texture that is being loaded, I'm just unsure how to solve it.

This is how the image is configured in the MonoGame pipeline:

LutConfig

I've tried the following variations of the LUT texture with no luck:

I've also tried all of these with and without mipmaps. Any ideas as to why this isn't working?

CrossVR commented 9 years ago

You need to turn off PremultiplyAlpha.

ResizeToPowerOfTwo is redundant and you don't want to GenerateMipmaps, so turn those off too.

altmoola commented 9 years ago

Well, I feel like an idiot. Thanks man, that worked.

CrossVR commented 9 years ago

Yeah, it's a bit annoying. I absolutely need to use all 4 channels to store the weights but a lot of imaging libraries pre-multiply the alpha values which messes with the data in the RGB channels.

CrossVR commented 9 years ago

Also, would you mind posting a picture of it working? I'm always interested to see the results of applying my shader.

altmoola commented 9 years ago

I think it was just one of those things. I was basically trying everything I could think of and was in the middle of figuring out your LUT generation code when I saw your response. Yet I didn't try the simplest thing first, testing all options in the pipeline config. Ah well.

Here is a picture of it working, as requested:

Working

Looks great! Thanks again.

altmoola commented 9 years ago

Here is the same scene with xBR (squared variation) for comparison:

XBR

Biggest complaint with the XBR one is that it really washes out the detail of the character sprite. I think HQX looks much better for him.

greyp commented 8 years ago

Hi guys, is there any chance that I get access to the HQX shader or xBR shader that you are using for MonoGame? I've been trying for a while to get xBR working in my game but got no success so far. I also tried translating Hyllian's xbr-lv2 shader to HLSL, but the end result looked similar to the first image in this thread... :(

CrossVR commented 8 years ago

@greyp There's a thread about it here if you're still looking for it: http://libretro.com/forums/showthread.php?t=4162