KDash, я MAMEUI не пользуюсь, и вам не рекомендую, глючной он в последнее время.
да, настройки можно/нужно прописать в mame.ini (прописать в конце или если настройки hlsl там уже есть - поверх их) и они будут использоваться во всех играх.
например для аркадного монитора:
hlsl_enable 1
hlslpath hlsl
shadow_mask_alpha 0.1
shadow_mask_texture aperture.png
shadow_mask_x_count 512
shadow_mask_y_count 384
shadow_mask_usize 0.125
shadow_mask_vsize 0.125
oversample_x 1.0
oversample_y 1.0
curvature 0.05
screen_scale_top 1.0
screen_scale_bottom 1.0
pincushion 0.05
scanline_alpha 0.5
scanline_size 1.0
scanline_bright_scale 1.0
scanline_bright_offset 0.7
scanline_jitter 0.0
defocus_x 0.0
defocus_y 0.0
red_converge_x 0.0
red_converge_y 0.0
green_converge_x 0.0
green_converge_y 0.0
blue_converge_x 0.0
blue_converge_y 0.0
red_radial_converge_x 0.0
red_radial_converge_y 0.0
green_radial_converge_x 0.0
green_radial_converge_y 0.0
blue_radial_converge_x 0.0
blue_radial_converge_y 0.0
red_from_r 1.0
red_from_g 0.0
red_from_b 0.0
green_from_r 0.0
green_from_g 1.0
green_from_b 0.0
blue_from_r 0.0
blue_from_g 0.0
blue_from_b 1.0
saturation 1.5
red_offset 0.0
green_offset 0.0
blue_offset 0.0
red_scale 1.1
green_scale 1.1
blue_scale 1.1
red_power 2.2
green_power 2.2
blue_power 2.2
red_floor 0.05
green_floor 0.05
blue_floor 0.05
red_phosphor_life 0.45
green_phosphor_life 0.45
blue_phosphor_life 0.45
yiq_enable 0
yiq_w 4.1887902047863909846168578443727
yiq_a 0.5
yiq_b 0.5
yiq_fsc 1.5
yiq_fsc_scale 0.5
yiq_phase_count 2
для HQ2X а оставлял всё по-умолчанию, только включал шейдеры (hlsl_enable 1), а содержимое шейдера hlsl\deconverge.fx заменил на:
//-----------------------------------------------------------------------------
// HQ2x Effect
//-----------------------------------------------------------------------------
texture Diffuse;
sampler DiffuseSampler = sampler_state
{
Texture = <Diffuse>;
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
};
//-----------------------------------------------------------------------------
// Vertex Definitions
//-----------------------------------------------------------------------------
struct VS_OUTPUT
{
float4 Position : POSITION;
float2 TexCoord : TEXCOORD0;
float4 TexPair0 : TEXCOORD1;
float4 TexPair1 : TEXCOORD2;
float4 TexPair2 : TEXCOORD3;
float4 TexPair3 : TEXCOORD4;
};
struct VS_INPUT
{
float4 Position : POSITION;
float4 Color : COLOR0;
float2 TexCoord : TEXCOORD0;
};
struct PS_INPUT
{
float2 TexCoord : TEXCOORD0;
float4 TexPair0 : TEXCOORD1;
float4 TexPair1 : TEXCOORD2;
float4 TexPair2 : TEXCOORD3;
float4 TexPair3 : TEXCOORD4;
};
//-----------------------------------------------------------------------------
// HQ2x Vertex Shader
//-----------------------------------------------------------------------------
float TargetWidth;
float TargetHeight;
float RawWidth;
float RawHeight;
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position.x /= TargetWidth;
Output.Position.y /= TargetHeight;
Output.Position.y = 1.0f - Output.Position.y;
Output.Position.x -= 0.5f;
Output.Position.y -= 0.5f;
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
float2 DownRight = float2(0.5f / RawWidth, 0.5f / RawHeight);
float2 DownLeft = DownRight * float2(-1.0f, 1.0f);
float2 PixWidth = float2(DownRight.x, 0.0f);
float2 PixHeight = float2(0.0f, DownRight.y);
Output.TexCoord = Input.TexCoord;
Output.TexPair0.xy = Input.TexCoord - DownRight;
Output.TexPair0.zw = Input.TexCoord - PixHeight;
Output.TexPair1.xy = Input.TexCoord - DownLeft;
Output.TexPair1.zw = Input.TexCoord + PixWidth;
Output.TexPair2.xy = Input.TexCoord + DownRight;
Output.TexPair2.zw = Input.TexCoord + PixHeight;
Output.TexPair3.xy = Input.TexCoord + DownLeft;
Output.TexPair3.zw = Input.TexCoord - PixWidth;
return Output;
}
//-----------------------------------------------------------------------------
// Deconvergence Pixel Shader
//-----------------------------------------------------------------------------
const float SmoothWeight = 0.325f;
const float MaxWeight = 0.25f;
const float MinWeight = -0.05f;
const float WeightDelta = -0.25f;
const float LumaOffset = 0.25f;
float4 ps_main(PS_INPUT Input) : COLOR
{
float3 UL = tex2D(DiffuseSampler, Input.TexPair0.xy);
float3 UU = tex2D(DiffuseSampler, Input.TexPair0.zw);
float3 UR = tex2D(DiffuseSampler, Input.TexPair1.xy);
float3 LL = tex2D(DiffuseSampler, Input.TexPair3.zw);
float3 CC = tex2D(DiffuseSampler, Input.TexCoord);
float3 RR = tex2D(DiffuseSampler, Input.TexPair1.zw);
float3 BL = tex2D(DiffuseSampler, Input.TexPair3.xy);
float3 BB = tex2D(DiffuseSampler, Input.TexPair2.zw);
float3 BR = tex2D(DiffuseSampler, Input.TexPair2.xy);
float3 DotSummer = float3(1.0f, 1.0f, 1.0f);
float Mid1 = dot(abs(UL - BR), DotSummer);
float Mid2 = dot(abs(UR - BL), DotSummer);
float Weight1 = dot(abs(BR - CC), DotSummer) * Mid2;
float Weight2 = dot(abs(BL - CC), DotSummer) * Mid1;
float Weight3 = dot(abs(UL - CC), DotSummer) * Mid2;
float Weight4 = dot(abs(UR - CC), DotSummer) * Mid1;
float Cross1 = Weight1 + Weight3;
float Cross2 = Weight2 + Weight4;
float Weight = max(Cross1, Cross2) + 0.0001f;
CC = (Weight1 * UL + Weight2 * UR + Weight3 * BR + Weight4 * BL + Weight * CC) / (Cross1 + Cross2 + Weight);
float RecipCenter1 = WeightDelta / (0.12f * dot(UU + CC + BB, DotSummer) + LumaOffset);
float RecipCenter2 = WeightDelta / (0.12f * dot(LL + CC + RR, DotSummer) + LumaOffset);
Weight1 = clamp(RecipCenter1 * dot(abs(CC - UU), DotSummer) + SmoothWeight, MinWeight, MaxWeight);
Weight2 = clamp(RecipCenter2 * dot(abs(CC - RR), DotSummer) + SmoothWeight, MinWeight, MaxWeight);
Weight3 = clamp(RecipCenter1 * dot(abs(CC - BB), DotSummer) + SmoothWeight, MinWeight, MaxWeight);
Weight4 = clamp(RecipCenter2 * dot(abs(CC - LL), DotSummer) + SmoothWeight, MinWeight, MaxWeight);
float3 OutColor = Weight1 * UU + Weight2 * RR + Weight3 * BB + Weight4 * LL + (1.0f - Weight1 - Weight2 - Weight3 - Weight4) * CC;
return float4(OutColor, 1.0f);
}
//-----------------------------------------------------------------------------
// HQ2x Effect
//-----------------------------------------------------------------------------
technique DeconvergeTechnique
{
pass Pass0
{
Lighting = FALSE;
VertexShader = compile vs_3_0 vs_main();
PixelShader = compile ps_3_0 ps_main();
}
}
больше разных настроек и шейдеров можно найти в
этой или
этой темах.