Pre-scaling before bilinear filtering for less-blurry image
3 Attachment(s)
This is probably already possible by stacking filters. Can anyone explain how because I haven't been able to figure it out.
I've been using a 1024×768-pixel Workbench. Text looks pretty small on my laptop, so I want to scale the image by 1.5× to have it occupy 1536×1152 pixels on-screen. Setting Horiz. size and Vert. size to 1.5× in Filter Settings works, but the result is pretty blurry. However, if I could pre-scale the image (e.g. pixel-doubling to 2048×1536 then scaling down with filtering to 1536×1152) the result would be significantly sharper. See the attached images. The blurrier scaled-up-1.5× image was created using a paint package rather than getting a screenshot of the filtered/scaled image in WinUAE. But it looks pretty similar. The other one was also made using a paint package, scaling up 2× then down with bilinear filtering. [After clicking a thumbnail, click the image to (hopefully) show it unscaled in your web browser.] |
RTG mode? I think it can do integer scaling quite easily (can be made simultaneously with color space conversion = not free if there is no need for conversion)
Chipset mode? Far from easy.. |
Wouldn't being able to apply two null filters work? In my example (which is a chipset mode), I could have the first filter scale by 3× with point filtering, the second filter by 0.5× with bilinear filtering. But it seems the various size & position options/sliders in filter settings are only applied once?
|
Quote:
|
2x 4x integer scaling of RTG modes would be useful for me, on HiDPI screens AmigaOS is pretty much unusable. 4x integer scaling would make this okay.
|
So to achieve what I want, I guess a D3D shader would have to be used? I think all the ones which come with WinUAE apply fancy scaling effects though, there isn't a simple pixel-doubling/tripling one.
|
It probably would make best quality. Supersampling mode may also help (1x/2x/3x/4x) menu next to "reset defaults" which allocates 2x/3x/4x larger texture size, shader writes to large texture, then it is scaled back to output size.
|
2 Attachment(s)
Like a complete noob I tried making my own shader by simply modifying _winuae.fx, changing filtermode to POINT in the SourceSampler definition:
Code:
sampler SourceSampler = sampler_state { D3D9Ex: SetTechnique: 8876086C S=1 F=0876 C=086C (2156) () Any idea what I'm doing wrong? |
You can't rename _winuae.fx and use it as a standalone shader. _winuae.fx is special case final pass which also includes support for masks and overlays.
|
1 Attachment(s)
OK so much for that.
I found this which looks like it could do the job, with suitable modifications??? https://github.com/mamedev/mame/blob...sl/prescale.fx |
6 Attachment(s)
I think I got an effect close to what I'm after by using this shader: http://www.si-gamer.net/gulikoza/src/point.fx
Using that unmodified there was an error in the WinUAE log, so I changed VertexShader = compile vs_1_1 VS(); PixelShader = compile ps_1_1 PS(); to VertexShader = compile vs_2_0 VS(); PixelShader = compile ps_2_0 PS(); after which it seemed to work OK. I put point_modified.fx as the -4 entry in filter settings, 2x in the box next to that. Extra settings set to bilinear (that applies to the final (null?) shader which WinUAE applies). Some screenshots are attached:
Note the much smaller file sizes for the mtpaint-created images. That's because they only use a small number of colours. For whatever reason the WinUAE-filter images have more than 256 different colours in them. |
Hi Mark,
I was interested in trying out your adjusted "pre-scaling shader" today (attached in post #11), as I wanted to see whether there's something similar to MAME's "prescale" factor before applying filtering (which your adjusted shader seems to do just that for WinUAE), but unfortunately it doesn't seem to work with D3D11. Just wondering, did you get it to work with latest WinUAE 3.6.1 and D3D11? |
Mark_K, what's the native resolution of your laptop screen?
|
I haven't done any more work on this since post #11 above. And I don't really know anything about shaders.
Laptop screen res is 1920×1200 but I was running WinUAE in a window. Trying to get a 1024×768-pixel Workbench to look a bit less blurry, 1.5× is the largest "round" scale factor which fits (WB screen would occupy 1536×1152 pixels). |
Quote:
It works the same way as the MAME prescale setting, i.e. you need to scale this shader 2x or 3x and set the bilinear option to true. It works very well for lowres screens, but unfortunately there's some scaling issue on hires screens that you may or may not notice. |
I tried for a long time to get this to work, and I could get it to work in FS-UAE but not in WinUAE.
http://eab.abime.net/showthread.php?t=89811 It is easy to test by looking at the text - in WinUAE, some pixels are more distorted then others after scaling. On FS-UAE, my shader "sharp-bilinear-simple" works perfectly and has been included in the Git repo already. |
I think there is not enough information, this is more like "it does not work" than including basic config, screenshots and more to describe it exactly. (I am still not sure if I understand what this is really supposed to do and why)
|
All times are GMT +2. The time now is 20:01. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.