MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Vsync/Frameskip Causing Horizontal Motion Blur
#380696 - 01/18/19 05:53 PM


Under the default settings I got screen tearing, so in the .ini file I set syncrefresh to 1. That caused audio stuttering so I also enabled autoframeskip, but now there's blurry pixel distortion during horizontal scrolling. I tested out various other setting combinations with waitvsync and frameskip as well but to no avail. The game I used to test this was The Tower of Druaga since the brick background makes it easy to see. I'm also using a 1080p monitor, not a CRT.



John IV
IV/Play, MAME, MAMEUI
Reged: 09/22/03
Posts: 1969
Loc: Washington, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380707 - 01/19/19 08:35 AM


Try -triplebuffer + -refreshspeed instead.



john iv
http://www.mameui.info/



Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: John IV]
#380718 - 01/19/19 05:16 PM


That reduced the blurring a good amount but now the sound is lower-picthed.



TafoidAdministrator
I keep on testing.. testing.. testing... into the future!
Reged: 04/19/06
Posts: 3135
Loc: USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380720 - 01/19/19 06:11 PM


> That reduced the blurring a good amount but now the sound is lower-picthed.

This is needed as the emulation is throttled back to your monitor refresh (which is typically a stable 60Hz) so games which run at higher Hz will have slightly lower pitched audio when keeping sync.



Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Tafoid]
#380721 - 01/19/19 06:29 PM


Interesting. Thanks for the info.



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380774 - 01/22/19 05:34 PM


If you are on windows and using BGFX as your video backend, try using D3D with waitvsync and triplebuffer. It works well for me without sound hiccups, and without having to use frameskip.

I played with the various settings on both backends and can post the different combinations of video-related parameters I use on each when I get home today, for you to try and see if it helps you.



Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: "The Manuel"]
#380775 - 01/22/19 05:38 PM


I just use the default 64 bit Windows release of Mame with no frontend, so D3D isn't in my config file.



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380776 - 01/22/19 05:45 PM


According to this, d3d is the default on Windows, so that is probably what you are using.



Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: "The Manuel"]
#380777 - 01/22/19 05:51 PM


Got it. I tried the settings you listed with everything else set to default (like refresh speed being 0) and the blurring is still there. Feel free to post those screenshots though, and thanks a bunch in advance. Don't feel obligated to, though.



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380784 - 01/23/19 12:39 AM


Below are my settings for D3D and for BGFX. If you haven't tried BGFX I recommend you try it as an alternative. I just realized that with D3D, when video scrolls smoother than BGFX, which is what I've been using for the last few months. I tested this on the first stage of Shinobi.

As with everything emulation, your mileage may vary.


Code:


#
# CORE PERFORMANCE OPTIONS
#
# With BGFX refreshpeed=1 does not work correctly but autoframeskip=1 prevents sound hiccups in galaga, mspacman and other >60Hz games
# This bug for BGFX is confirmed by mametesters bug ID#06346 from Sep, 2016 and is still open
autoframeskip 1
frameskip 0
seconds_to_run 0
throttle 1
sleep 0
speed 1.0
# Enable refreshspeed when using D3D to avoid sound hiccups on games >60Hz like galaga
# With BGFX, it doesn work correctly and the hiccups persist, so no harm in leaving it on with either renderer
refreshspeed 1

#
# OSD VIDEO OPTIONS
#
video bgfx
#video d3d
numscreens 1
window 0
maximize 1
# Triplebuffer is supposedly preferrable to waitvsync but only works with D3D
# Some from of sync is needed to avoid tearing/microstuttering (as in the 1st stage of shinobi) so use waitvsync with BGFX
waitvsync 1
syncrefresh 0
monitorprovider auto

#
#
# FULL SCREEN OPTIONS
#
# When using D3D, triplebuffer is preferable to waitvsync but it doesn't work with BGFX
# There is no harm to leave it enabled with either renderer
triplebuffer 1
full_screen_brightness 1.0
full_screen_contrast 1.0
full_screen_gamma 1.0



If BGFX gives you good results, I highly recommend trying out this built-in CRT shader for a CRT look:
bgfx_screen_chains crt-geom-deluxe,crt-geom-deluxe
bgfx_shadow_mask slot-mask.png



Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: "The Manuel"]
#380786 - 01/23/19 01:23 AM


W O A H
I did all the BGFX stuff you recommended and it looks not only damn great without the CRT filter but PERFECT with it enabled. Thank you so so much, I was actually about to take a really long break from emulation from all the dead-ends I was reaching but this rejuvenated me.



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380788 - 01/23/19 01:54 AM


Man, you've made my day. My posts are seldom helpful to anyone but knowing that at least I was able to help someone warms my heart.

For completeness, I had made a few modifications to crt-geom-deluxe for my own use, mostly related to simulated screen curvature and I really like how it looks when framed by artwork with bezels. It's just something to check out but you may prefer the default. To try it, you can create a backup copy of the D:\MAME\bgfx\chains\crt-geom-deluxe.json file, then replace its contents with the code below.


Code:

{
"name": "CRT-geom",
"author": "cgwg",
"sliders": [
{ "type": "float",
"name": "aperture_strength",
"text": "Shadow mask strength",
"default": 0.4,
"max" : 1.0,
"min" : 0.0,
"step" : 0.05,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "phosphor_power",
"text": "Phosphor decay power",
"default": 1.2,
"max" : 3.0,
"min" : 0.5,
"step" : 0.05,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "phosphor_amplitude",
"text": "Phosphor persistence amplitude",
"default": 0.04,
"max" : 0.2,
"min" : 0.0,
"step" : 0.01,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "halation",
"text": "Halation amplitude",
"default": 0.1,
"max" : 0.3,
"min" : 0.0,
"step" : 0.01,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "blurwidth",
"text": "Halation blur width",
"default": 2.0,
"max" : 4.0,
"min" : 0.1,
"step" : 0.1,
"format": "%1.1f",
"screen": "raster" },
{ "type": "float",
"name": "curvature",
"text": "Enable curvature",
"default": 1.0,
"max" : 1.0,
"min" : 0.0,
"step" : 1.0,
"format": "%1.0f",
"screen": "raster" },
{ "type": "float",
"name": "R",
"text": "Radius of curvature",
"default": 3.5,
"max" : 10.0,
"min" : 0.5,
"step" : 0.1,
"format": "%1.1f",
"screen": "raster" },
{ "type": "float",
"name": "d",
"text": "Distance to screen",
"default": 2.0,
"max" : 10.0,
"min" : 0.1,
"step" : 0.1,
"format": "%1.1f",
"screen": "raster" },
{ "type": "vec2",
"name": "angle",
"text": "Tilt ",
"default": [ 0.0, 0.0 ],
"max" : [ 1.0, 1.0 ],
"min" : [-1.0,-1.0 ],
"step" : 0.01,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "cornersize",
"text": "Rounded corner size",
"default": 0.01,
"max" : 0.10,
"min" : 0.00,
"step" : 0.01,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "cornersmooth",
"text": "Border smoothness",
"default": 1000,
"max" : 2000,
"min" : 100,
"step" : 100,
"format": "%1.0f",
"screen": "raster" },
{ "type": "vec2",
"name": "overscan",
"text": "Overscan ",
"default": [ 1.0, 1.0 ],
"max" : [ 1.2, 1.2 ],
"min" : [ 0.8, 0.8 ],
"step" : 0.02,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "CRTgamma",
"text": "Gamma of simulated CRT",
"default": 2.4,
"max" : 4.0,
"min" : 0.7,
"step" : 0.05,
"format": "%1.2f",
"screen": "raster" },
{ "type": "float",
"name": "monitorgamma",
"text": "Gamma of output display",
"default": 2.2,
"max" : 4.0,
"min" : 0.7,
"step" : 0.05,
"format": "%1.2f",
"screen": "raster" },
{ "type": "vec2",
"name": "aspect",
"text": "Aspect ratio ",
"default": [ 1.0, 0.75 ],
"max" : [ 1.0, 1.0 ],
"min" : [ 0.3, 0.3 ],
"step" : 0.01,
"format": "%1.2f",
"screen": "raster" }
],
"targets": [
{ "name": "internal1",
"mode": "guest"
},
{ "name": "internal2",
"mode": "guest"
},
{ "name": "blur",
"mode": "guest"
},
{ "name": "phosphor",
"mode": "guest"
}

],
"passes": [
{
"effect": "crt-geom/phosphor_apply",
"name": "phosphor apply",
"uniforms": [
{ "uniform": "u_phosphor_power", "slider": "phosphor_power" },
{ "uniform": "u_phosphor_amplitude","slider": "phosphor_amplitude" },
{ "uniform": "u_gamma", "slider": "CRTgamma" }
],
"input": [
{ "sampler": "s_screen", "target": "screen" },
{ "sampler": "s_phosphor", "target": "phosphor" }
],
"output": "internal1"
},
{
"effect": "crt-geom/phosphor_update",
"name": "phosphor update",
"uniforms": [
{ "uniform": "u_phosphor_power", "slider": "phosphor_power" },
{ "uniform": "u_phosphor_amplitude","slider": "phosphor_amplitude" },
{ "uniform": "u_gamma", "slider": "CRTgamma" }
],
"input": [
{ "sampler": "s_screen", "target": "screen" },
{ "sampler": "s_phosphor", "target": "phosphor" }
],
"output": "phosphor"
},
{
"effect": "crt-geom/gaussx",
"name": "Gaussian blur x",
"uniforms": [
{ "uniform": "u_width", "slider": "blurwidth" },
{ "uniform": "u_aspect","slider": "aspect" },
{ "uniform": "u_gamma", "slider": "CRTgamma" }
],
"input": [
{ "sampler": "s_tex", "target": "internal1" }
],
"output": "internal2"
},
{
"effect": "crt-geom/gaussy",
"name": "Gaussian blur y",
"uniforms": [
{ "uniform": "u_width", "slider": "blurwidth" },
{ "uniform": "u_aspect","slider": "aspect" },
{ "uniform": "u_gamma", "slider": "CRTgamma" }
],
"input": [
{ "sampler": "s_tex", "target": "internal2" }
],
"output": "blur"
},
{
"effect": "crt-geom/crt-geom-deluxe",
"name": "CRT",
"uniforms": [
{ "uniform": "curvature", "slider": "curvature" },
{ "uniform": "R", "slider": "R" },
{ "uniform": "d", "slider": "d" },
{ "uniform": "angle", "slider": "angle" },
{ "uniform": "cornersize", "slider": "cornersize" },
{ "uniform": "cornersmooth","slider": "cornersmooth" },
{ "uniform": "overscan", "slider": "overscan" },
{ "uniform": "aspect", "slider": "aspect" },
{ "uniform": "CRTgamma", "slider": "CRTgamma" },
{ "uniform": "monitorgamma","slider": "monitorgamma" },
{ "uniform": "aperture_strength","slider": "aperture_strength" },
{ "uniform": "halation", "slider": "halation" }
],

"input": [
{ "sampler": "mpass_texture", "target": "internal1" },
{ "sampler": "mask_texture", "texture": "bgfx/chains/crt-geom/aperture_1_2_bgr.png", "selection": "Shadow mask" },
{ "sampler": "blur_texture", "target": "blur" }
],

"output": "output"
}
]
}




Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: "The Manuel"]
#380789 - 01/23/19 03:08 AM


This looks great Is there any way that we can set it to automatically use BGFX with the crt-geom-deluxe.json?



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: "The Manuel"]
#380794 - 01/23/19 05:01 AM


One more thing. I edited the individual video settings for Tower of Druaga then set them back to how the other ROMs are and now the graphics settings don't adhere to the config file, .ie the CRT filter doesn't work. What's that about?



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Envisaged0ne]
#380796 - 01/23/19 06:14 AM


Yes; in the mame.ini file, set:


Code:


video bgfx
bgfx_backend auto
# Specify the shader twice so that games with two screens show the shader on both:
bgfx_screen_chains crt-geom-deluxe, crt-geom-deluxe



Edited by "The Manuel" (01/23/19 06:15 AM)



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380797 - 01/23/19 06:17 AM


> One more thing. I edited the individual video settings for Tower of Druaga then set
> them back to how the other ROMs are and now the graphics settings don't adhere to the
> config file, .ie the CRT filter doesn't work. What's that about?

When you say that you edited the individual video setting, do you mean in the game's .ini file? Can you post its contents?
If you mean that you made adjustments to the video settings by pressing the "~" key to bring up the hud controls, those settings do not get saved.



Kilo
MAME Fan
Reged: 01/18/19
Posts: 8
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: "The Manuel"]
#380798 - 01/23/19 06:45 AM


Nevermind, just had to delete the cfg file that got created in the root folder. Also I was talking about right-clicking on the ROM in the default UI and selecting "video options".



Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: "The Manuel"]
#380806 - 01/23/19 10:46 AM


Thank you very much!



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



"The Manuel"
Old Fart
Reged: 10/08/03
Posts: 244
Loc: Michigan, USA
Send PM


Re: Vsync/Frameskip Causing Horizontal Motion Blur new [Re: Kilo]
#380817 - 01/23/19 04:16 PM


OK. I did not realize you were using MAMEUI. I'm glad you got it sorted out.


Pages: 1

MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 366 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 962