mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
Small shader corrections (nw)
This commit is contained in:
parent
f056b622bc
commit
2f06a08ec4
15 changed files with 8 additions and 8 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -176,9 +176,9 @@ float GetRoundCornerFactor(float2 coord, float2 bounds, float radiusAmount, floa
|
|||
smoothAmount = min(smoothAmount, radiusAmount);
|
||||
|
||||
float range = min(bounds.x, bounds.y);
|
||||
float amountMinimum = range > 0.0f ? 1.0f / range : 0.0f;
|
||||
float amountMinimum = 1.0f / range;
|
||||
float radius = range * max(radiusAmount, amountMinimum);
|
||||
float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 3.0f));
|
||||
float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f));
|
||||
|
||||
// compute box
|
||||
float box = roundBox(bounds * (coord * 2.0f), bounds, radius);
|
||||
|
|
|
@ -67,7 +67,7 @@ struct PS_INPUT
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
static const float PI = 3.1415927f;
|
||||
static const float PHI = 1.618034f;
|
||||
static const float HalfPI = PI * 0.5f;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Scanline & Shadowmask Vertex Shader
|
||||
|
@ -259,7 +259,7 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
|||
|
||||
ScanlineCoord *= SourceDims.y * ScanlineScale * PI;
|
||||
|
||||
float ScanlineCoordJitter = ScanlineOffset * PHI;
|
||||
float ScanlineCoordJitter = ScanlineOffset * HalfPI;
|
||||
float ScanlineSine = sin(ScanlineCoord + ScanlineCoordJitter);
|
||||
float ScanlineWide = ScanlineHeight + ScanlineVariation * max(1.0f, ScanlineHeight) * (1.0f - ColorBrightness);
|
||||
float ScanlineAmount = pow(ScanlineSine * ScanlineSine, ScanlineWide);
|
||||
|
|
|
@ -82,9 +82,9 @@ float GetRoundCornerFactor(float2 coord, float2 bounds, float radiusAmount, floa
|
|||
smoothAmount = min(smoothAmount, radiusAmount);
|
||||
|
||||
float range = min(bounds.x, bounds.y);
|
||||
float amountMinimum = range > 0.0f ? 1.0f / range : 0.0f;
|
||||
float amountMinimum = 1.0f / range;
|
||||
float radius = range * max(radiusAmount, amountMinimum);
|
||||
float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 3.0f));
|
||||
float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f));
|
||||
|
||||
// compute box
|
||||
float box = roundBox(bounds * (coord * 2.0f), bounds, radius);
|
||||
|
|
|
@ -105,7 +105,7 @@ float GetRoundCornerFactor(vec2 coord, vec2 bounds, float radiusAmount, float sm
|
|||
float range = min(bounds.x, bounds.y);
|
||||
float amountMinimum = range > 0.0f ? 1.0f / range : 0.0f;
|
||||
float radius = range * max(radiusAmount, amountMinimum);
|
||||
float smooth_val = 1.0f / (range * max(smoothAmount, amountMinimum * 3.0f));
|
||||
float smooth_val = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f));
|
||||
|
||||
// compute box
|
||||
float box = roundBox(bounds * (coord * 2.0f), bounds, radius);
|
||||
|
|
|
@ -155,7 +155,7 @@ void main()
|
|||
|
||||
ScanCoord *= u_source_dims.y * u_scanline_scale.x * 3.1415927; // PI
|
||||
|
||||
float ScanCoordJitter = u_scanline_jitter.x * u_jitter_amount.x * 1.618034; // PHI
|
||||
float ScanCoordJitter = u_scanline_jitter.x * u_jitter_amount.x * 1.5707963; // half PI
|
||||
float ScanSine = sin(ScanCoord + ScanCoordJitter);
|
||||
float ScanlineWide = u_scanline_height.x + u_scanline_variation.x * max(1.0, u_scanline_height.x) * (1.0 - ColorBrightness);
|
||||
float ScanSineScaled = pow(ScanSine * ScanSine, ScanlineWide);
|
||||
|
|
Loading…
Reference in a new issue