Moved "color floor" functionality to occur after scanlines but before shadow mask. Scanlines look much better and no longer cut black lines through the shadow mask. No whatsnew.

This commit is contained in:
Ryan Holtz 2011-05-30 21:40:25 +00:00
parent 796e691522
commit 773e35d79b
3 changed files with 10 additions and 6 deletions

View File

@ -130,9 +130,6 @@ float4 ps_main(PS_INPUT Input) : COLOR
OutRGB.g = pow(Saturated.g, GrnPower);
OutRGB.b = pow(Saturated.b, BluPower);
// -- Color Compression (increasing the floor of the signal without affecting the ceiling) --
OutRGB = float3(RedFloor + (1.0f - RedFloor) * OutRGB.r, GrnFloor + (1.0f - GrnFloor) * OutRGB.g, BluFloor + (1.0f - BluFloor) * OutRGB.b);
return float4(OutRGB, BaseTexel.a);
}

View File

@ -112,6 +112,10 @@ uniform float ShadowV = 0.375f;
uniform float ShadowWidth = 8.0f;
uniform float ShadowHeight = 8.0f;
uniform float RedFloor = 0.0f;
uniform float GrnFloor = 0.0f;
uniform float BluFloor = 0.0f;
float4 ps_main(PS_INPUT Input) : COLOR
{
float2 Ratios = float2(WidthRatio, HeightRatio);
@ -160,6 +164,9 @@ float4 ps_main(PS_INPUT Input) : COLOR
float3 ScanBrightness = lerp(1.0f, pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0f, ScanlineAmount);
float3 Scanned = BaseTexel.rgb * ScanBrightness;
// -- Color Compression (increasing the floor of the signal without affecting the ceiling) --
Scanned = float3(RedFloor + (1.0f - RedFloor) * Scanned.r, GrnFloor + (1.0f - GrnFloor) * Scanned.g, BluFloor + (1.0f - BluFloor) * Scanned.b);
float2 ShadowDims = float2(ShadowWidth, ShadowHeight);
float2 ShadowUV = float2(ShadowU, ShadowV);
float2 ShadowMaskSize = float2(ShadowMaskSizeX, ShadowMaskSizeY);

View File

@ -2973,6 +2973,9 @@ static void primitive_flush_pending(d3d_info *d3d)
(*d3dintf->effect.set_float)(curr_effect, "HeightRatio", 1.0f / (poly->texture->vstop - poly->texture->vstart));
(*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
(*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
(*d3dintf->effect.set_float)(curr_effect, "RedFloor", options->screen_red_floor);
(*d3dintf->effect.set_float)(curr_effect, "GrnFloor", options->screen_green_floor);
(*d3dintf->effect.set_float)(curr_effect, "BluFloor", options->screen_blue_floor);
(*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->screen_pincushion);
(*d3dintf->effect.set_float)(curr_effect, "CurvatureAmount", options->screen_curvature);
(*d3dintf->effect.set_float)(curr_effect, "UseShadow", d3d->shadow_texture == NULL ? 0.0f : 1.0f);
@ -3125,9 +3128,6 @@ static void primitive_flush_pending(d3d_info *d3d)
(*d3dintf->effect.set_float)(curr_effect, "RedPower", options->screen_red_power);
(*d3dintf->effect.set_float)(curr_effect, "GrnPower", options->screen_green_power);
(*d3dintf->effect.set_float)(curr_effect, "BluPower", options->screen_blue_power);
(*d3dintf->effect.set_float)(curr_effect, "RedFloor", options->screen_red_floor);
(*d3dintf->effect.set_float)(curr_effect, "GrnFloor", options->screen_green_floor);
(*d3dintf->effect.set_float)(curr_effect, "BluFloor", options->screen_blue_floor);
(*d3dintf->effect.set_float)(curr_effect, "Saturation", options->screen_saturation);
result = (*d3dintf->device.set_render_target)(d3d->device, 0, d3d->hlslsmalltarget0[poly->texture->target_index]);