English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 24 September 2018, 22:00   #1
lbg83430
 
Posts: n/a
Scanlines offset in WinUAE

A question to Toni Wilen about how WinUAE displays scanlines in the "Filter" tab.

Lets say (that's an example) that i run "James Pond 2" on CD32 by using a host resolution of 1600x1200 with the following settings:
- Single line mode.
- "No scaling" filter.
- Horizontal and vertical scaling equal to 2 and 4 respectively.

Each rendered Amiga pixel will cover 2 pixels in width and 4 pixels in height on the host screen. Thus, the scanlines setting matching perfectly this rescaling would (and should) be, for each rendered pixels, "3 contiguous lines, followed by 1 darkened one". In other words, the last line of each rendered pixel should be used to simulate a gap between each rendered line.

WinUAE doesn't seem to draw the darkened line on the expected vertical position, this creating an unevitable offset. So, Toni, my question is quite simple (and my motivations to ask a such thing might sound to you kinda mysterious): did you choose to display the first darkened scanlined by basing yourself on the first line of the host resolution? For now don't ask me why i'm asking you a such thing, i promise to tell you more in my next post and especially to SHOW you why i'm interested by this. That will be a private message for sure even if a public demonstration video is already ready.

Last edited by lbg83430; 24 September 2018 at 22:46.
 
Old 25 September 2018, 08:54   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
I didn't choose anything, I just did something that seemed to work as scanlines. I personally hate normal scanlines, IMO only RGB mask/shader based scanlines can look like real scanlines. But I can add simple vertical offset option to scanline options if it helps.
Toni Wilen is offline  
Old 25 September 2018, 13:02   #3
lbg83430
 
Posts: n/a
Well, the way scanlines are displayed at the moment doesn't work, so a vertical offset would be welcome.

Taking the above example, the darkened line isn't drawn at the bottom of each rendered pixel if "1:4" is selected (ie a "gfx_filter_scanlineratio=" value equal to 20).

The rule to have perfect "normal" scanlines would be the same the following:

-----------------
Lets Y be the vertical scaling factor in single or double line mode.
- If Y>=2, then a scanlines option "1:Y-1" draws 1 darkened line at the bottom of each rendered pixel,
then draws Y-1 normal rendered line above.
- If Y=1, then a scanlines option "1:1" draws 1 darkened rendered line of pixel, followed by 1 normal rendered
line of pixel (*).

(*) Obviously, the option "1:1" works and already drawn scanlines as expected.
-----------------

If you can add an offset that would be perfect, but if you can correct this by applying the scanlines filter on the very first bottom line of the display surface used by a game it would be even better. You got what i mean: the way that scanlines are drawn mustn't be affected by the chosen host resolution.

Do you think that's possible?

NB: Note that it's the exact way MAME proceeds, and i garantee you that the result is quite amazing. A video will follow, but i don't tell more for now.

Last edited by lbg83430; 02 November 2018 at 12:10.
 
Old 02 November 2018, 12:08   #4
lbg83430
 
Posts: n/a
I'm currently doing quick demos of my dynamic pixel perfect launcher on most important french Amiga group, for the curious or interested ones.

I join a picture to expose the issue, based on dynamic computation done from an assumed (false, of course, that's just an example) original hardware maximum fullscreen PAL resolution of 640x512.

Below here a pixel perfect screen shot of the output rendered image. My launcher determined dynamically than, within all the resolutions handled by your host monitor, a 1280x960 would be the most pixel perfect one that by using a horizontal X and vertical integer scaling X=Y=2. Again, this result is an evidence, that's not the topic of my post.

Now, look well the darken line at the botton of the last rescaled line of the "t" in the word "Operation". This line should be 1 pixel line under. So a scanline offset should be added (it's in fact mandatory regarding the actual behaviour) to draw the darken line at the proper position, because the way they're drawn at the moment breaks totally the rendered image.

Tony, do you think that it's possible for you to modify your code?

Ideally you should invert the behaviour and name of the "1:N" as i described above.

NB: The actual "N:1" seems to me useless as it draws big darken lines, if i were you i would simply remove it but that's only my view.
Attached Thumbnails
Click image for larger version

Name:	IMG_8113.JPG
Views:	219
Size:	123.8 KB
ID:	60560  
 
Old 02 November 2018, 16:03   #5
lbg83430
 
Posts: n/a
Exactly Photon! I sent him a private message. Also, I forgot one thing: The number of normal lines drawn must be divided by 2 in hires, of course. Meaning that the scanlines filter must be changed on-the-fly at each resolution change.

It's highly important, otherwise that's NOT possible to render the screen properly with scanlines if the vertical integer scaling factor is greater or equal than 2.
 
Old 02 November 2018, 17:18   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Offset was already added few betas ago.

I won't touch any software filters anymore. Shaders or RGB masks is the correct method today.
Toni Wilen is offline  
Old 02 November 2018, 18:33   #7
lbg83430
 
Posts: n/a
Thanks Tony, I will try the offset and also check the shaders and RGB masks too.
A question though, does the normal filter adapts itself to the low/hi resolution switch?
 
Old 05 November 2018, 15:09   #8
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
I came here from your reply Toni, but now I don't see it or any of my replies. Forum bug??

lbg, I'm reading Toni's reply as the only way is shaders. Tried a bunch, but they don't give "just scanlines" and they're not easily tweakable to do so, and trickier to make work in hires, most of them are by and for the console crowd.
Photon is offline  
Old 05 November 2018, 15:20   #9
DamienD
Banned
 
DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
Quote:
Originally Posted by Photon View Post
I came here from your reply Toni, but now I don't see it or any of my replies. Forum bug??
Toni moved your posts to a new thread, see here Photon: Filter issues(?)...
DamienD is offline  
Old 05 November 2018, 15:27   #10
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Ah, as I wrote I clicked his reply and came to this thread. Confusing! Thx.
Photon 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
Calculate offset using labels Beska Coders. Asm / Hardware 7 09 May 2016 18:56
gfxbase negative offset Asman Coders. System 14 28 May 2015 23:24
Modifying WinUAE's scanlines line mode mark_k support.WinUAE 24 18 November 2013 21:07
Automatically disable Direct3D scanlines/mask during interlaced screens (WinUAE) Maren request.UAE Wishlist 6 26 September 2010 09:14
Scanlines don't work in new mini WinUAE dreamkatcha support.WinUAE 0 27 July 2003 17:59

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 21:46.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08078 seconds with 16 queries