English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 21 March 2018, 15:39   #61
Dr.Venom
Registered User
 
Join Date: Jul 2008
Location: Netherlands
Posts: 400
OK, I see.

Is the shader scaling always done according to the supersampling setting, or is it also possible to hardcode a scaling factor in the shader itself (and does WinUAE apply it)?

Not sure if this makes any sense (I know little about how the filters and scaling are stacked in WinUAE), but what if besides the current supersampling options in WinUAE (1x,2x,3x,4x) there would be a "0" option, which would mean the supersampling pass / scaling is skipped in total.

Would it then work to hardcode a (2x, 3x ,4x) scaling factor in the point-prescale shader and then combined with the "0" setting on the supersampling menu possibly have a sharp-bilinear output without the irregularities?
Dr.Venom is offline  
Old 21 March 2018, 16:45   #62
guest.r
Registered User

guest.r's Avatar
 
Join Date: May 2017
Location: EU
Posts: 132
Quote:
Is the shader scaling always done according to the supersampling setting, or is it also possible to hardcode a scaling factor in the shader itself (and does WinUAE apply it)?
WinUAE had to use a meta shader format similar to RA/Higan/FS-UAE...
I endorse it, why not. It would resolve the situation in many other ways also. I think this should be put on the TODO list somewhere in the future.


Quote:
Not sure if this makes any sense (I know little about how the filters and scaling are stacked in WinUAE), but what if besides the current supersampling options in WinUAE (1x,2x,3x,4x) there would be a "0" option, which would mean the supersampling pass / scaling is skipped in total.
D3D11 only supports one functional pass for now and there are two ways i understand this. First is similar to which the null-filter does and second is to add a true 1x scaling option (which means no scaling) but with active shader.
It could be asked to add this.

Quote:
Would it then work to hardcode a (2x, 3x ,4x) scaling factor in the point-prescale shader and then combined with the "0" setting on the supersampling menu possibly have a sharp-bilinear output without the irregularities?
Irregularities are connected with real (non integer) scaling factors and even a "true sharp bilinear" can't handle all quality wise. Something would pass as good quality on a retina display (high scaling factor) and would look bad on a 27'' 1080p monitor, especially if we are talking HiRes OS situations.

I'll add an example of FS-UAE WHDLoad loading pattern which looks somewhat irregular too, but games look decent enough. It's same with WinUAE.
Attached Thumbnails
Click image for larger version

Name:	SharpBilinear-FS-UAE.png
Views:	154
Size:	45.3 KB
ID:	57420  
guest.r is offline  
Old 21 March 2018, 16:49   #63
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 46
Posts: 11,227
Yep, noticed the same about the blue WHDLoad splash screen. As you said, the games looks always good enough.
Retro-Nerd is offline  
Old 22 March 2018, 13:41   #64
Dr.Venom
Registered User
 
Join Date: Jul 2008
Location: Netherlands
Posts: 400
Quote:
Originally Posted by guest.r View Post
Irregularities are connected with real (non integer) scaling factors and even a "true sharp bilinear" can't handle all quality wise. Something would pass as good quality on a retina display (high scaling factor) and would look bad on a 27'' 1080p monitor, especially if we are talking HiRes OS situations.
Good point.

Quote:
I'll add an example of FS-UAE WHDLoad loading pattern which looks somewhat irregular too, but games look decent enough. It's same with WinUAE.
Thanks for posting that FS-UAE picture. I think the FS-UAE output is correct. I'm still not fully convinved though that it's the same for the WinUAE output.

I've attached a picture of the WinUAE output with two areas highlighted. From this it can be clearly seen that the pattern on the left in the blue canvas is quite different from the pattern on the right. The source picture should have no differences in the squares, so I don't understand how point sampling delivers such a different result left and right? (With FS-UAE there's no such difference.)

It's this that makes me not totally convinced there isn't a scaling issue somewhere. From reading the forums, it may relate to the same issue that rsn8887 encountered. See his thread here: NULL Filter discrepancies

That said, I'm very much pleased with how the filter looks on low resolution game screens, so thanks again for creating it
Attached Thumbnails
Click image for larger version

Name:	different_patterns_left_and_right.png
Views:	140
Size:	77.0 KB
ID:	57440  
Dr.Venom is offline  
Old 22 March 2018, 21:37   #65
guest.r
Registered User

guest.r's Avatar
 
Join Date: May 2017
Location: EU
Posts: 132
Yeah it's definitely worth it to get a better understanding of the situation.
In fact, i was looking for an example where there is a glitch that explains and reveals something more.

It's obvious that higher multiplier produces a more even image, but there shouldn't be differences beside overall image sharpness in the case of proper integer scaling.

Viewer caution advised below, the image is somewhat disturbed.

So my initial assumption that there is always internal integer scaling at work might be wrong. But that's nothing that can't be fixed i think.
Attached Images
 
guest.r is offline  
Old 23 March 2018, 15:02   #66
Dr.Venom
Registered User
 
Join Date: Jul 2008
Location: Netherlands
Posts: 400
Quote:
Originally Posted by guest.r View Post
Viewer caution advised below, the image is somewhat disturbed.

So my initial assumption that there is always internal integer scaling at work might be wrong. But that's nothing that can't be fixed i think.
From what screenmode did you take that picture, low-res or high-res?

I think I may have found a clue.

I booted into Workbench and changed the native screenmode to PAL: Low Res (320x256), i.e. 1:1 pixel ratio. To my surprise the issue doesn't occur now: the pattern in the left and right part of the blue canvas is the same (like it should). See attached image.

This suggest the issue with custom shaders and scaling occurs when native field mode has a 2:1 pixel aspect ratio (like in workbench) , but not when the field aspect ratio is 1:1, like in games. (It also explains why both you, retro-nerd and me didn't see any issues with the filtered graphics in games, as those are all 1:1 pixel aspect ratio.)

Toni, does this provide a lead to dig into the code?
Attached Thumbnails
Click image for larger version

Name:	splash_screen_when_started_from_Low_Res_320x256_workbench.png
Views:	115
Size:	102.7 KB
ID:	57458  
Dr.Venom is offline  
Old 24 March 2018, 12:17   #67
Tomislav
Registered User

 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 144
Those settings are made mainly for games which are almost all in lowres. Hires, like Workbench, became ugly with it.
Tomislav is offline  
Old 25 March 2018, 17:22   #68
guest.r
Registered User

guest.r's Avatar
 
Join Date: May 2017
Location: EU
Posts: 132
Yeah, hi-res is sort off the default setting, but it gives most of the shaders a hard time to handle both games and productivity.

This reminded me to upgrade the crt-hires shader, now it does a better job and the soud doesn't crackle with higher multipliers.

I also modified the default _winuae.fx shader to apply the mask in gamma space. Heavier aperture masks look much better and are worth a try. I think it makes the change in D3D9 mode only.

If you want default mask handling, then the modified version can be deleted and the original will be auto generated.

Attached Files
File Type: rar _winuae.rar (872 Bytes, 102 views)
File Type: rar CRT-Guest-Hi-Res.rar (1.9 KB, 106 views)

Last edited by guest.r; 25 March 2018 at 17:59. Reason: Shader update.
guest.r is offline  
Old 25 March 2018, 17:34   #69
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 46
Posts: 11,227
Could you add sharpness and saturation too, please.
Retro-Nerd is offline  
Old 25 March 2018, 18:00   #70
guest.r
Registered User

guest.r's Avatar
 
Join Date: May 2017
Location: EU
Posts: 132
No problem, i've updated it above.
guest.r is offline  
Old 25 March 2018, 18:09   #71
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 46
Posts: 11,227
Ah, great. You are the best.
Retro-Nerd is offline  
Old 26 March 2018, 11:30   #72
Dr.Venom
Registered User
 
Join Date: Jul 2008
Location: Netherlands
Posts: 400
Quote:
Originally Posted by Dr.Venom View Post
From what screenmode did you take that picture, low-res or high-res?

I think I may have found a clue.

I booted into Workbench and changed the native screenmode to PAL: Low Res (320x256), i.e. 1:1 pixel ratio. To my surprise the issue doesn't occur now: the pattern in the left and right part of the blue canvas is the same (like it should). See attached image.

This suggest the issue with custom shaders and scaling occurs when native field mode has a 2:1 pixel aspect ratio (like in workbench) , but not when the field aspect ratio is 1:1, like in games. (It also explains why both you, retro-nerd and me didn't see any issues with the filtered graphics in games, as those are all 1:1 pixel aspect ratio.)

Toni, does this provide a lead to dig into the code?
Toni, could you possibly make a custom build of WinUAE, purely for testing purposes, where you replace the null filter .fx shader in direct3d.cpp with the point-prescale.fx code from the shader attached in the post here (also copied below)?

I'm really wondering whether when this shader is hardcoded into the same path as the null filter (which has no issue in hires mode), whether the scaling issue in hires / 2:1 pixel mode with custom shaders / the point-prescale.fx is also resolved.


Code:
// Simple point upscaler
// License: Freeware

string name : NAME = "point";

float2 ps                       : TEXELSIZE;

float4x4 World                  : WORLD;
float4x4 View                   : VIEW;
float4x4 Projection             : PROJECTION;
float4x4 Worldview              : WORLDVIEW;               // world * view
float4x4 ViewProjection         : VIEWPROJECTION;          // view * projection
float4x4 WorldViewProjection    : WORLDVIEWPROJECTION;     // world * view * projection

string combineTechique          : COMBINETECHNIQUE = "POINT";

texture SourceTexture            : SOURCETEXTURE;

sampler    decal = sampler_state
{
    Texture      = (SourceTexture);
    MinFilter = POINT;
    MagFilter = POINT;
};


struct out_vertex {
    float4 position : POSITION;
    float4 color    : COLOR;
    float2 t0       : TEXCOORD0;
}; 
 

out_vertex  VS_VERTEX(float3 position : POSITION, float2 texCoord : TEXCOORD0 )
{ 
    out_vertex OUT = (out_vertex)0;

    OUT.position = mul(float4(position,1.0),WorldViewProjection);
    OUT.t0 = texCoord;
    return OUT;  
}



float4 PS_FRAGMENT (in out_vertex VAR) : COLOR
{    

    return tex2D(decal, VAR.t0);    
}



technique POINT
{
    pass P0
    {
        // shaders        
        VertexShader = compile vs_2_0 VS_VERTEX();
        PixelShader  = compile ps_2_0 PS_FRAGMENT(); 
    }  
}
Dr.Venom is offline  
Old 27 March 2018, 20:15   #73
21stcentury
Registered User

 
Join Date: Jul 2014
Location: Paris
Posts: 23
For who know it I am the publisher of Ultimate Amiga Configurations and I present you my last work (not yet published). Are you interested because I stopped every projects last year ?

http://nsa39.casimages.com/img/2018/...1946524152.png
http://nsa39.casimages.com/img/2018/...2911677336.png
http://nsa39.casimages.com/img/2018/...7404070799.png
http://nsa39.casimages.com/img/2018/...4213580527.png

Don't forget to click fo to enlarge them.

Last edited by 21stcentury; 27 March 2018 at 20:36.
21stcentury is offline  
Old 02 April 2018, 16:21   #74
nobody
Registered User

nobody's Avatar
 
Join Date: Dec 2013
Location: GR
Age: 41
Posts: 1,203
Any chance to port "crt-pi" shader? Looks good and is light-weight too.



https://github.com/libretro/glsl-sha...rs/crt-pi.glsl
nobody is offline  
Old 02 April 2018, 16:25   #75
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 46
Posts: 11,227
Looks similar to CRT-Easymode.
Retro-Nerd is offline  
Old 02 April 2018, 16:41   #76
nobody
Registered User

nobody's Avatar
 
Join Date: Dec 2013
Location: GR
Age: 41
Posts: 1,203
Actually I think it's based on crt-geom. Crt-easymode runs 20fps on my cellphone and crt-pi runs 60fps easily.
nobody is offline  
Old 02 April 2018, 16:43   #77
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 46
Posts: 11,227
CRT-Geom is in the WinUAE shader pack though.

http://eab.abime.net/showpost.php?p=...9&postcount=28
Retro-Nerd is offline  
Old 02 April 2018, 16:48   #78
nobody
Registered User

nobody's Avatar
 
Join Date: Dec 2013
Location: GR
Age: 41
Posts: 1,203
The point is that crt-pi is very lightweight. Meant to run full speed on a humble raspberry pi.
nobody is offline  
Old 02 April 2018, 16:49   #79
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 46
Posts: 11,227
You mean they are in a .fx compatible format on the raspi? Thought you meant WinUAE shader actually for WinUAE.
Retro-Nerd is offline  
Old 02 April 2018, 16:54   #80
nobody
Registered User

nobody's Avatar
 
Join Date: Dec 2013
Location: GR
Age: 41
Posts: 1,203
They are in .glsl format I believe. I use it on my cellphone on retroarch and it's the only CRT shader running 60fps (together with crt-nes-mini). Looks fine, not very fancy but does the job.
nobody is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multipass shaders craig64 support.FS-UAE 20 10 July 2017 23:45
HLSL/CG Shaders and xBR Enverex support.FS-UAE 11 19 July 2013 17:44
fx Shaders in WinUAE 2.6.0 crazy46guy support.WinUAE 8 16 June 2013 15:30
[FS-UAE] Optimized or corrected Amiga Game Database Entrys nexusle support.FS-UAE 3 24 August 2012 22:30
Subpixel-corrected lines and polygons on Amiga Scali Coders. Asm / Hardware 9 11 January 2012 13:37

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.09059 seconds with 14 queries