Author Topic: xBR filter  (Read 48910 times)

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: xBR filter
« Reply #45 on: April 21, 2012, 05:36:26 AM »
Thanks guys.

I added support for each of the nine options to all the blitters that support softFX.

Would still really like to get some HLSL in there though. Guess I might have to start looking to DirectX programming at some point.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline Twinaphex

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +8/-0
Re: xBR filter
« Reply #46 on: April 21, 2012, 07:58:12 AM »
Thanks guys.

I added support for each of the nine options to all the blitters that support softFX.

Would still really like to get some HLSL in there though. Guess I might have to start looking to DirectX programming at some point.

You can take a look at xdk360_video.cpp and shader_hlsl.c from SSNES 360 - only some functions in the render context creation should be 360-specific, the rest should mostly work on PC.

I'm in the process of adding 'FBO mode' (render targets on D3D/HLSL) to it - which will enable two shader passes at once.

Offline msbhvn

  • New Member
  • *
  • Posts: 5
  • Karma: +0/-0
Re: xBR filter
« Reply #47 on: April 21, 2012, 02:23:20 PM »
Thanks for your kind words, Hyllian. I'll experiment with which flavours of xBR I like best until 0.2.97.25 comes out with all of them added. :cool:

I'll have to keep recompiling because I don't want to mess up the menu any more than I already have, can anyone tell me what I missed? When I select 3xBR or 4xBR there's no indicator to say which SoftFX option is selected. It's a small thing, I know, but just in case I find another algorithm in future and want to experiment... :biggrin:

I'm still astounded that it works. All I did was copy the code, copy the function parameters from hq3x, then I just looked at how the other algorithms were added to the menu and copied that, although I didn't do that perfectly.

My main motivation for doing it was that I only have ancient onboard graphics in my PC, so HLSL and other shaders run really slowly.
« Last Edit: April 21, 2012, 02:38:59 PM by msbhvn »

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: xBR filter
« Reply #48 on: April 21, 2012, 02:37:18 PM »
Thanks for your kind words, Hyllian. I'll experiment with which flavours of xBR I like best until 0.2.97.25 comes out with all of them added. :cool:

I'll have to keep recompiling because I don't want to mess up the menu any more than I already have, can anyone tell me what I missed? When I select 3xBR or 4xBR there's no indicator to say which SoftFX option is selected. It's a small thing, I know, but just in case I find another algorithm in future and want to experiment... :biggrin:

I'm still astounded that it works. All I did was copy the code, copy the function parameters from hq3x, then I just looked at how the other algorithms were added to the menu and copied that, although I didn't do that perfectly.

More than likely it's the changes to menu.cpp that are required.

Specifically the CheckMenuRadioItem for each blitter menu needs updating to check all the filter menu items. After adding the nine options the enhanced menu code became;

Code: [Select]
CheckMenuRadioItem(hMenu, MENU_ENHANCED_SOFT_STRETCH, MENU_ENHANCED_SOFT_STRETCH + 33, var, MF_BYCOMMAND);
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline msbhvn

  • New Member
  • *
  • Posts: 5
  • Karma: +0/-0
Re: xBR filter
« Reply #49 on: April 21, 2012, 02:46:59 PM »
Ah, that's it, because I don't remember changing that. Thanks. :smilie:
« Last Edit: April 21, 2012, 03:05:25 PM by msbhvn »

Offline Hyllian

  • Newbies
  • *
  • Posts: 22
  • Karma: +3/-0
Re: xBR filter
« Reply #50 on: April 25, 2012, 05:55:37 AM »
Hi, lantus.

I've managed to make a xBR 3.7a shader work on 360 through the RetroArch emulator squarepusher is working.

This is the shader which works in hlsl mode: https://github.com/twinaphex/common-shaders/blob/master/xBR/hlsl/5xBR-v3.7a.cg

I had to unroll all vector comparisons to make it work in hlsl mode. I don't know what happens, but it seems hlsl doesn't support vector comparisons.

For example, this line:

Code: [Select]
bool4 fx;
float4 Ao, Bo, Co;

fx      = (Ao*fp.y+Bo*fp.x > Co);

I had to unroll to their components, that is, to scalar comparisons:

Code: [Select]
  fx.x      = (Ao.x*fp.y+Bo.x*fp.x > Co.x);
  fx.y      = (Ao.y*fp.y+Bo.y*fp.x > Co.y);
  fx.z      = (Ao.z*fp.y+Bo.z*fp.x > Co.z);
  fx.w     = (Ao.w*fp.y+Bo.w*fp.x > Co.w);

Do you have any idea why the first way only work in Cg mode? If it's the case, I think hlsl is less advanced than Cg.
« Last Edit: April 25, 2012, 06:00:08 AM by Hyllian »

Offline pmc2

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +3/-0
Re: xBR filter
« Reply #51 on: June 22, 2012, 05:06:34 AM »
« Last Edit: June 22, 2012, 05:08:36 AM by pmc2 »