From 35ef098e64a825890a98cec461a955d08f4cdb91 Mon Sep 17 00:00:00 2001 From: Ryan Holtz Date: Wed, 22 May 2013 01:58:38 +0000 Subject: MAME Testers bugs fixed: 5201, 5202 - HLSL changes: [MooglyGuy] * Upped vertex buffer size to 64k verts, fixes assert in starwars and alphaone, please include the printed error message in any subsequent encounterings of the assert. * Improved vector rendering (beam width 1.5 suggested) * Ducked raster bloom default to 0.225 to reduce washout --- hlsl/bloom.fx | 1 + hlsl/color.fx | 1 + hlsl/deconverge.fx | 1 + hlsl/downsample.fx | 21 ++++++++++++--------- hlsl/focus.fx | 1 + hlsl/phosphor.fx | 1 + hlsl/pincushion.fx | 1 + hlsl/post.fx | 1 + hlsl/prescale.fx | 1 + hlsl/primary.fx | 1 + hlsl/vector.fx | 16 ++++++++++------ hlsl/yiq_decode.fx | 1 + hlsl/yiq_encode.fx | 1 + 13 files changed, 33 insertions(+), 15 deletions(-) (limited to 'hlsl') diff --git a/hlsl/bloom.fx b/hlsl/bloom.fx index a39657c2d9f..83f87a2961d 100644 --- a/hlsl/bloom.fx +++ b/hlsl/bloom.fx @@ -156,6 +156,7 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/color.fx b/hlsl/color.fx index e22bd17634b..95881d71c2c 100644 --- a/hlsl/color.fx +++ b/hlsl/color.fx @@ -31,6 +31,7 @@ struct VS_INPUT float4 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/deconverge.fx b/hlsl/deconverge.fx index 3943b2666cd..1478dd23418 100644 --- a/hlsl/deconverge.fx +++ b/hlsl/deconverge.fx @@ -36,6 +36,7 @@ struct VS_INPUT float4 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/downsample.fx b/hlsl/downsample.fx index 9790af2b4a5..e4e3b400ee7 100644 --- a/hlsl/downsample.fx +++ b/hlsl/downsample.fx @@ -32,6 +32,7 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT @@ -62,10 +63,11 @@ VS_OUTPUT vs_main(VS_INPUT Input) Output.Position.xy *= float2(2.0f, 2.0f); Output.Color = Input.Color; float2 inversePixel = 1.0f / ScreenSize; - Output.TexCoord01.xy = Input.Position.xy / ScreenSize + float2(0.5f, 0.5f) / TargetSize; - Output.TexCoord01.zw = Input.Position.xy / ScreenSize + float2(1.5f, 0.5f) / TargetSize; - Output.TexCoord23.xy = Input.Position.xy / ScreenSize + float2(0.5f, 1.5f) / TargetSize; - Output.TexCoord23.zw = Input.Position.xy / ScreenSize + float2(1.5f, 1.5f) / TargetSize; + Output.TexCoord01.xy = Input.Position.xy / ScreenSize + float2(1.0f, 1.0f) / TargetSize; + //Output.TexCoord01.xy = Input.Position.xy / ScreenSize + float2(0.5f, 0.5f) / TargetSize; + //Output.TexCoord01.zw = Input.Position.xy / ScreenSize + float2(1.5f, 0.5f) / TargetSize; + //Output.TexCoord23.xy = Input.Position.xy / ScreenSize + float2(0.5f, 1.5f) / TargetSize; + //Output.TexCoord23.zw = Input.Position.xy / ScreenSize + float2(1.5f, 1.5f) / TargetSize; return Output; } @@ -77,11 +79,12 @@ VS_OUTPUT vs_main(VS_INPUT Input) float4 ps_main(PS_INPUT Input) : COLOR { float4 texel0 = tex2D(DiffuseSampler, Input.TexCoord01.xy); - float4 texel1 = tex2D(DiffuseSampler, Input.TexCoord01.zw); - float4 texel2 = tex2D(DiffuseSampler, Input.TexCoord23.xy); - float4 texel3 = tex2D(DiffuseSampler, Input.TexCoord23.zw); - float4 outTexel = (texel0 + texel1 + texel2 + texel3) * BloomRescale; - return float4(outTexel.rgb, 1.0f); + //float4 texel1 = tex2D(DiffuseSampler, Input.TexCoord01.zw); + //float4 texel2 = tex2D(DiffuseSampler, Input.TexCoord23.xy); + //float4 texel3 = tex2D(DiffuseSampler, Input.TexCoord23.zw); + //float4 outTexel = (texel0 + texel1 + texel2 + texel3) * BloomRescale; + //return float4(outTexel.rgb, 1.0f); + return float4(texel0.rgb, 1.0f); } //----------------------------------------------------------------------------- diff --git a/hlsl/focus.fx b/hlsl/focus.fx index 0df9c876b2b..f51957d630c 100644 --- a/hlsl/focus.fx +++ b/hlsl/focus.fx @@ -38,6 +38,7 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx index b1a7f983435..b1842fdf02a 100644 --- a/hlsl/phosphor.fx +++ b/hlsl/phosphor.fx @@ -45,6 +45,7 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/pincushion.fx b/hlsl/pincushion.fx index 03f4dbc278d..7e856c6ca26 100644 --- a/hlsl/pincushion.fx +++ b/hlsl/pincushion.fx @@ -34,6 +34,7 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/post.fx b/hlsl/post.fx index 5b4640db496..7bbda640dcf 100644 --- a/hlsl/post.fx +++ b/hlsl/post.fx @@ -44,6 +44,7 @@ struct VS_INPUT float4 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/prescale.fx b/hlsl/prescale.fx index 965d89691f8..3c207875ca2 100644 --- a/hlsl/prescale.fx +++ b/hlsl/prescale.fx @@ -30,6 +30,7 @@ struct VS_INPUT float4 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/primary.fx b/hlsl/primary.fx index 53653cfba16..472c2dc4692 100644 --- a/hlsl/primary.fx +++ b/hlsl/primary.fx @@ -31,6 +31,7 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/vector.fx b/hlsl/vector.fx index e93d8dee4cf..89072253e88 100644 --- a/hlsl/vector.fx +++ b/hlsl/vector.fx @@ -11,6 +11,7 @@ struct VS_OUTPUT float4 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 LineInfo : TEXCOORD1; }; struct VS_INPUT @@ -18,12 +19,14 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 LineInfo : TEXCOORD1; }; struct PS_INPUT { float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 LineInfo : TEXCOORD1; }; //----------------------------------------------------------------------------- @@ -48,7 +51,7 @@ VS_OUTPUT vs_main(VS_INPUT Input) Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f); Output.Color = Input.Color; Output.TexCoord = Input.Position.xy / float2(TargetWidth, TargetHeight); - + Output.LineInfo = Input.LineInfo; return Output; } @@ -58,17 +61,18 @@ VS_OUTPUT vs_main(VS_INPUT Input) // TimeParams.x: Frame time of the vector // TimeParams.y: How much frame time affects the vector's fade -// LengthParams.x: Length of the vector // LengthParams.y: How much length affects the vector's fade // LengthParams.z: Size at which fade is maximum float4 ps_main(PS_INPUT Input) : COLOR { - float timeModulate = lerp(1.0f, TimeParams.x, TimeParams.y) * 2.0; + float timeModulate = lerp(1.0f, TimeParams.x, TimeParams.y) * 1.0; - float lengthModulate = clamp(1.0f - LengthParams.x / LengthParams.z, 0.0f, 1.0f); - lengthModulate = lerp(1.0f, timeModulate * lengthModulate, LengthParams.y) * 2.0; + float lengthModulate = 1.0f - clamp(Input.LineInfo.x / LengthParams.z, 0.0f, 1.0f); + float minLength = 2.0f - clamp(Input.LineInfo.x - 1.0f, 0.0f, 2.0f); + lengthModulate = lerp(lengthModulate, 4.0f, minLength * 0.5f); + lengthModulate = lerp(1.0f, timeModulate * lengthModulate, LengthParams.y) * 1.0; - float4 outColor = Input.Color * float4(lengthModulate, lengthModulate, lengthModulate, 1.0f) * 8.0; + float4 outColor = Input.Color * float4(lengthModulate, lengthModulate, lengthModulate, 1.0f) * 2.0; return outColor; } diff --git a/hlsl/yiq_decode.fx b/hlsl/yiq_decode.fx index af3c01c34ab..afbdb98e528 100644 --- a/hlsl/yiq_decode.fx +++ b/hlsl/yiq_decode.fx @@ -43,6 +43,7 @@ struct VS_INPUT float4 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT diff --git a/hlsl/yiq_encode.fx b/hlsl/yiq_encode.fx index 2a2a1e40851..8793bfbb633 100644 --- a/hlsl/yiq_encode.fx +++ b/hlsl/yiq_encode.fx @@ -34,6 +34,7 @@ struct VS_INPUT float4 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; + float2 Unused : TEXCOORD1; }; struct PS_INPUT -- cgit v1.2.3-70-g09d2