mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
commit
b1cd05ee52
@ -10,10 +10,9 @@ yiq_enable 0/1 Enables YIQ-colorspace post-processing.
|
||||
hlslpath [path] Path to the .fx files that are in use. (default: hlsl)
|
||||
hlsl_prescale_x [horizontal] HLSL pre-scale override factor for X. (0 for auto)
|
||||
hlsl_prescale_y [vertical] HLSL pre-scale override factor for Y. (0 for auto)
|
||||
hlsl_preset -1 through 3 HLSL preset to use. (default: -1)
|
||||
hlsl_write [filename] Enable HLSL AVI writing. (huge disk bandwidth suggested)
|
||||
hlsl_write [filename] Enables HLSL AVI writing. (huge disk bandwidth suggested)
|
||||
hlsl_snap_width [width] HLSL upscaled-snapshot width. (default: 2048)
|
||||
hlsl_snap_height [height] HLSL upscaled-snapshot height. (default: 1536)
|
||||
hlsl_snap_height [height] HLSL upscaled-snapshot height. (default: 1536)
|
||||
|
||||
|
||||
Surface/Color Processing Parameters
|
||||
@ -22,12 +21,17 @@ Surface/Color Processing Parameters
|
||||
Name Values Description
|
||||
shadow_mask_alpha 0.0 to 1.0 The ovearll darkness of each shadow mask pixel.
|
||||
shadow_mask_texture [filename] A PNG that defines the shadow mask for each pixel.
|
||||
shadow_mask_x_count 1+ The count of shadow mask elements, X (usually 640-ish).
|
||||
shadow_mask_y_count 1+ The count of shadow mask elements, Y (usually 480-ish).
|
||||
shadow_mask_usize 0.0 to 1.0 These parameters define the *in-use* pixel count on the
|
||||
shadow_mask_vsize 0.0 to 1.0 X and Y axes of the shadow mask texture.
|
||||
curvature 0.0 to 1.0 Screen curvature. Affects borders and shadow mask.
|
||||
pincushion 0.0 to 1.0 Image curvature. Affects the source image only.
|
||||
shadow_mask_x_count 1+ The number of pixels one shadow mask tile uses on screen.
|
||||
shadow_mask_y_count 1+ This stretches the shadow mask tiles on X and Y axis.
|
||||
shadow_mask_usize 0.0 to 1.0 The size of one shadow mask tile in U/V coordinate.
|
||||
shadow_mask_vsize 0.0 to 1.0 The shadow mask textures always has a size of power-of-two.
|
||||
shadow_mask_voffset -1.0 to 1.0 The offset of the shadow mask texture in U/V coordinates.
|
||||
shadow_mask_voffset -1.0 to 1.0 An offset of 1.0 repressents one pixel on screen.
|
||||
curvature 0.0 to 1.0 Curvature amount of the screen.
|
||||
round_corner 0.0 to 1.0 Rounded corners amount of the screen.
|
||||
smooth_border 0.0 to 1.0 Smooth borders amount of the screen.
|
||||
reflection 0.0 to 1.0 Refelection amount of the screen highlight.
|
||||
vignetting 0.0 to 1.0 Vignetting amount of the image.
|
||||
scanline_alpha 0.0 to 1.0 The overall darkness of each scanline furrow.
|
||||
scanline_size 0.0 to 4.0 The overall height of each scanline.
|
||||
scanline_height [height] Individual height scaling value for scanlines.
|
||||
@ -97,8 +101,8 @@ vector_length_ratio 500.0 Vector fade length (4.0 - vectors fade t
|
||||
Bloom Post-Processing Options
|
||||
-----------------------------
|
||||
Name Default Values Description
|
||||
vector_bloom_scale 0.300 Intensity factor for vector bloom. (0.000-1.000)
|
||||
raster_bloom_scale 0.225 Intensity factor for raster bloom. (0.000-1.000)
|
||||
bloom_scale 0.500 Bloom intensity factor. (0.000-2.000)
|
||||
bloom_overdrive 0.00,0.00,0.00 Bloom overdrive factor to bright full saturated colors. (0.000-2.000)
|
||||
bloom_lvl0_weight 1.00 Bloom level 0 (full-size target) weight. (0.00-1.00)
|
||||
bloom_lvl1_weight 0.21 Bloom level 1 (half-size target) weight. (0.00-1.00)
|
||||
bloom_lvl2_weight 0.19 Bloom level 2 (quarter-size target) weight. (0.00-1.00)
|
||||
|
@ -152,6 +152,9 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
||||
// Post-Processing Pixel Shader
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
uniform float2 ScreenScale = float2(1.0f, 1.0f);
|
||||
uniform float2 ScreenOffset = float2(0.0f, 0.0f);
|
||||
|
||||
uniform float ScanlineAlpha = 1.0f;
|
||||
uniform float ScanlineScale = 1.0f;
|
||||
uniform float ScanlineBrightScale = 1.0f;
|
||||
@ -232,7 +235,7 @@ float GetSpotAddend(float2 coord, float amount)
|
||||
: float2(-0.25f, 0.25f)
|
||||
: OrientationSwapXY
|
||||
? float2(0.25f, 0.25f)
|
||||
: float2(-0.25f, 0.25f);
|
||||
: float2(-0.25f, 0.25f);
|
||||
|
||||
float2 SpotCoord = coord;
|
||||
SpotCoord += spotOffset * RatioCorrection;
|
||||
@ -334,6 +337,34 @@ float2 GetCoords(float2 coord, float2 centerOffset, float distortionAmount)
|
||||
return coord;
|
||||
}
|
||||
|
||||
float2 GetAdjustedCoords(float2 coord, float2 centerOffset, float distortionAmount)
|
||||
{
|
||||
float2 RatioCorrection = GetRatioCorrection();
|
||||
|
||||
// center coordinates
|
||||
coord -= centerOffset;
|
||||
|
||||
// apply ratio difference between screen and quad
|
||||
coord /= RatioCorrection;
|
||||
|
||||
// apply screen scale
|
||||
coord /= ScreenScale;
|
||||
|
||||
// distort coordinates
|
||||
coord = GetDistortedCoords(coord, distortionAmount);
|
||||
|
||||
// revert ratio difference between screen and quad
|
||||
coord *= RatioCorrection;
|
||||
|
||||
// un-center coordinates
|
||||
coord += centerOffset;
|
||||
|
||||
// apply screen offset
|
||||
coord += (centerOffset * 2.0) * ScreenOffset;
|
||||
|
||||
return coord;
|
||||
}
|
||||
|
||||
float4 ps_main(PS_INPUT Input) : COLOR
|
||||
{
|
||||
float2 ScreenTexelDims = 1.0f / ScreenDims;
|
||||
@ -345,8 +376,14 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
float2 ScreenCoord = Input.ScreenCoord / ScreenDims;
|
||||
ScreenCoord = GetCoords(ScreenCoord, float2(0.5f, 0.5f), CurvatureAmount);
|
||||
|
||||
float2 DistortionCoord = Input.TexCoord;
|
||||
DistortionCoord = GetCoords(DistortionCoord, HalfSourceRect, CurvatureAmount);
|
||||
|
||||
float2 BaseCoord = Input.TexCoord;
|
||||
BaseCoord = GetCoords(BaseCoord, HalfSourceRect, CurvatureAmount);
|
||||
BaseCoord = GetAdjustedCoords(BaseCoord, HalfSourceRect, CurvatureAmount);
|
||||
|
||||
float2 DistortionCoordCentered = DistortionCoord;
|
||||
DistortionCoordCentered -= HalfSourceRect;
|
||||
|
||||
float2 BaseCoordCentered = BaseCoord;
|
||||
BaseCoordCentered -= HalfSourceRect;
|
||||
@ -354,6 +391,11 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
float4 BaseColor = tex2D(DiffuseSampler, BaseCoord);
|
||||
BaseColor.a = 1.0f;
|
||||
|
||||
if (BaseCoord.x < 0.0f || BaseCoord.y < 0.0f)
|
||||
{
|
||||
BaseColor.rgb = 0.0f;
|
||||
}
|
||||
|
||||
// Mask Simulation (may not affect bloom)
|
||||
if (!PrepareBloom)
|
||||
{
|
||||
@ -431,7 +473,7 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
// Vignetting Simulation (may not affect bloom)
|
||||
if (!PrepareBloom)
|
||||
{
|
||||
float2 VignetteCoord = BaseCoordCentered;
|
||||
float2 VignetteCoord = DistortionCoordCentered;
|
||||
|
||||
float VignetteFactor = GetVignetteFactor(VignetteCoord, VignettingAmount);
|
||||
Output.rgb *= VignetteFactor;
|
||||
@ -442,8 +484,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
{
|
||||
float3 LightColor = float3(1.0f, 0.90f, 0.80f);
|
||||
|
||||
float2 SpotCoord = BaseCoordCentered;
|
||||
float2 NoiseCoord = BaseCoordCentered;
|
||||
float2 SpotCoord = DistortionCoordCentered;
|
||||
float2 NoiseCoord = DistortionCoordCentered;
|
||||
|
||||
float SpotAddend = GetSpotAddend(SpotCoord, ReflectionAmount);
|
||||
float NoiseFactor = GetNoiseFactor(SpotAddend, random(NoiseCoord));
|
||||
@ -451,7 +493,7 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
}
|
||||
|
||||
// Round Corners Simulation (may affect bloom)
|
||||
float2 RoundCornerCoord = BaseCoordCentered;
|
||||
float2 RoundCornerCoord = DistortionCoordCentered;
|
||||
|
||||
float roundCornerFactor = GetRoundCornerFactor(RoundCornerCoord, RoundCornerAmount, SmoothBorderAmount);
|
||||
Output.rgb *= roundCornerFactor;
|
||||
|
37
hlsl/post.fx
37
hlsl/post.fx
@ -77,6 +77,7 @@ bool xor(bool a, bool b)
|
||||
|
||||
uniform float2 ScreenDims; // size of the window or fullscreen
|
||||
uniform float2 SourceDims; // size of the texture in power-of-two size
|
||||
uniform float2 SourceRect; // size of the uv rectangle
|
||||
uniform float2 TargetDims; // size of the target surface
|
||||
|
||||
uniform float2 ShadowDims = float2(32.0f, 32.0f); // size of the shadow texture (extended to power-of-two size)
|
||||
@ -87,6 +88,7 @@ uniform bool RotationSwapXY = false; // swapped default screen orientation due t
|
||||
|
||||
uniform bool PrepareBloom = false; // disables some effects for rendering bloom textures
|
||||
uniform bool PrepareVector = false;
|
||||
uniform bool PrepareRaster = false;
|
||||
|
||||
VS_OUTPUT vs_main(VS_INPUT Input)
|
||||
{
|
||||
@ -123,6 +125,9 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
||||
// Post-Processing Pixel Shader
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
uniform float2 ScreenScale = float2(1.0f, 1.0f);
|
||||
uniform float2 ScreenOffset = float2(0.0f, 0.0f);
|
||||
|
||||
uniform float ScanlineAlpha = 1.0f;
|
||||
uniform float ScanlineScale = 1.0f;
|
||||
uniform float ScanlineBrightScale = 1.0f;
|
||||
@ -137,17 +142,43 @@ uniform float2 ShadowUV = float2(0.25f, 0.25f);
|
||||
uniform float3 Power = float3(1.0f, 1.0f, 1.0f);
|
||||
uniform float3 Floor = float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float2 GetAdjustedCoords(float2 coord, float2 centerOffset)
|
||||
{
|
||||
// center coordinates
|
||||
coord -= centerOffset;
|
||||
|
||||
// apply screen scale
|
||||
coord /= ScreenScale;
|
||||
|
||||
// un-center coordinates
|
||||
coord += centerOffset;
|
||||
|
||||
// apply screen offset
|
||||
coord += (centerOffset * 2.0) * ScreenOffset;
|
||||
|
||||
return coord;
|
||||
}
|
||||
|
||||
float4 ps_main(PS_INPUT Input) : COLOR
|
||||
{
|
||||
float2 ScreenTexelDims = 1.0f / ScreenDims;
|
||||
|
||||
float2 HalfSourceRect = PrepareVector
|
||||
? float2(0.5f, 0.5f)
|
||||
: SourceRect * 0.5f;
|
||||
|
||||
float2 ScreenCoord = Input.ScreenCoord / ScreenDims;
|
||||
float2 BaseCoord = Input.TexCoord;
|
||||
float2 BaseCoord = GetAdjustedCoords(Input.TexCoord, HalfSourceRect);
|
||||
|
||||
// Color
|
||||
float4 BaseColor = tex2D(DiffuseSampler, BaseCoord);
|
||||
BaseColor.a = 1.0f;
|
||||
|
||||
if (BaseCoord.x < 0.0f || BaseCoord.y < 0.0f)
|
||||
{
|
||||
BaseColor.rgb = 0.0f;
|
||||
}
|
||||
|
||||
// Mask Simulation (may not affect bloom)
|
||||
if (!PrepareBloom)
|
||||
{
|
||||
@ -204,8 +235,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
// Scanline Simulation (may not affect bloom)
|
||||
if (!PrepareBloom)
|
||||
{
|
||||
// Scanline Simulation (disabled for vector)
|
||||
if (!PrepareVector)
|
||||
// Scanline Simulation (only for raster screen)
|
||||
if (PrepareRaster)
|
||||
{
|
||||
float InnerSine = BaseCoord.y * ScanlineScale * SourceDims.y;
|
||||
float ScanJitter = ScanlineOffset * SourceDims.y;
|
||||
|
@ -360,7 +360,7 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_
|
||||
{
|
||||
// an initial parse to capture the initial set of values
|
||||
bool result;
|
||||
|
||||
|
||||
core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
|
||||
// keep adding slot options until we stop seeing new stuff
|
||||
|
@ -924,7 +924,8 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
|
||||
m_base_view(NULL),
|
||||
m_base_orientation(ROT0),
|
||||
m_maxtexwidth(65536),
|
||||
m_maxtexheight(65536)
|
||||
m_maxtexheight(65536),
|
||||
m_transform_primitives(true)
|
||||
{
|
||||
// determine the base layer configuration based on options
|
||||
m_base_layerconfig.set_backdrops_enabled(manager.machine().options().use_backdrops());
|
||||
@ -1659,6 +1660,13 @@ void render_target::add_container_primitives(render_primitive_list &list, const
|
||||
float yoffs = (container_xform.orientation & ORIENTATION_SWAP_XY) ? container.xoffset() : container.yoffset();
|
||||
if (container_xform.orientation & ORIENTATION_FLIP_X) xoffs = -xoffs;
|
||||
if (container_xform.orientation & ORIENTATION_FLIP_Y) yoffs = -yoffs;
|
||||
if (!m_transform_primitives)
|
||||
{
|
||||
xscale = 1.0f;
|
||||
yscale = 1.0f;
|
||||
xoffs = 0.0f;
|
||||
yoffs = 0.0f;
|
||||
}
|
||||
container_xform.xscale = xform.xscale * xscale;
|
||||
container_xform.yscale = xform.yscale * yscale;
|
||||
if (xform.no_center)
|
||||
|
@ -898,6 +898,7 @@ public:
|
||||
void set_orientation(int orientation) { m_orientation = orientation; }
|
||||
void set_view(int viewindex);
|
||||
void set_max_texture_size(int maxwidth, int maxheight);
|
||||
void set_transform_primitives(bool transform_primitives) { m_transform_primitives = transform_primitives; }
|
||||
|
||||
// layer config getters
|
||||
bool backdrops_enabled() const { return m_layerconfig.backdrops_enabled(); }
|
||||
@ -996,6 +997,8 @@ private:
|
||||
simple_list<render_container> m_debug_containers; // list of debug containers
|
||||
INT32 m_clear_extent_count; // number of clear extents
|
||||
INT32 m_clear_extents[MAX_CLEAR_EXTENTS]; // array of clear extents
|
||||
bool m_transform_primitives; // determines if the primitives shall be scaled/offset by screen settings,
|
||||
// otherwise the respective render API will handle it (default is true)
|
||||
|
||||
static render_screen_list s_empty_screen_list;
|
||||
};
|
||||
|
@ -131,14 +131,18 @@ const device_type VECTOR = &device_creator<vector_device>;
|
||||
vector_device::vector_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
|
||||
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||
device_video_interface(mconfig, *this),
|
||||
m_vector_list(NULL)
|
||||
m_vector_list(NULL),
|
||||
m_min_intensity(255),
|
||||
m_max_intensity(0)
|
||||
{
|
||||
}
|
||||
|
||||
vector_device::vector_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, VECTOR, "VECTOR", tag, owner, clock, "vector_device", __FILE__),
|
||||
device_video_interface(mconfig, *this),
|
||||
m_vector_list(NULL)
|
||||
device_video_interface(mconfig, *this),
|
||||
m_vector_list(NULL),
|
||||
m_min_intensity(255),
|
||||
m_max_intensity(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -221,24 +225,18 @@ void vector_device::add_point(int x, int y, rgb_t color, int intensity)
|
||||
{
|
||||
point *newpoint;
|
||||
|
||||
if (intensity > 255)
|
||||
{
|
||||
intensity = 255;
|
||||
}
|
||||
intensity = MAX(0, MIN(255, intensity));
|
||||
|
||||
m_min_intensity = intensity > 0 ? MIN(m_min_intensity, intensity) : m_min_intensity;
|
||||
m_max_intensity = intensity > 0 ? MAX(m_max_intensity, intensity) : m_max_intensity;
|
||||
|
||||
if (m_flicker && (intensity > 0))
|
||||
{
|
||||
float random = (float)(machine().rand() & 255) / 255.0f; // random value between 0.0 and 1.0
|
||||
|
||||
intensity -= (int)(intensity * random * m_flicker);
|
||||
if (intensity < 0)
|
||||
{
|
||||
intensity = 0;
|
||||
}
|
||||
if (intensity > 255)
|
||||
{
|
||||
intensity = 255;
|
||||
}
|
||||
|
||||
intensity = MAX(0, MIN(255, intensity));
|
||||
}
|
||||
|
||||
newpoint = &m_vector_list[m_vector_index];
|
||||
@ -334,10 +332,17 @@ UINT32 vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
|
||||
}
|
||||
else
|
||||
{
|
||||
float intensity = (float)curpoint->intensity / 255.0f;
|
||||
float intensity_weight = normalized_sigmoid(intensity, m_beam_intensity_weight);
|
||||
float beam_intensity_width = m_beam_width_min;
|
||||
|
||||
float intensity = (float)curpoint->intensity / 255.0f;
|
||||
|
||||
// check for dynamic intensity
|
||||
if (m_min_intensity != m_max_intensity)
|
||||
{
|
||||
float intensity_weight = normalized_sigmoid(intensity, m_beam_intensity_weight);
|
||||
beam_intensity_width = (m_beam_width_max - m_beam_width_min) * intensity_weight + m_beam_width_min;
|
||||
}
|
||||
|
||||
float beam_intensity_width = (m_beam_width_max - m_beam_width_min) * intensity_weight + m_beam_width_min;
|
||||
float beam_width = beam_intensity_width * (1.0f / (float)VECTOR_WIDTH_DENOM);
|
||||
|
||||
coords.x0 = ((float)lastx - xoffs) * xscale;
|
||||
|
@ -67,6 +67,8 @@ private:
|
||||
static float m_beam_intensity_weight;
|
||||
point *m_vector_list;
|
||||
static int m_vector_index;
|
||||
int m_min_intensity;
|
||||
int m_max_intensity;
|
||||
|
||||
float normalized_sigmoid(float n, float k);
|
||||
};
|
||||
|
@ -52,116 +52,12 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp
|
||||
|
||||
namespace d3d
|
||||
{
|
||||
hlsl_options shaders::s_hlsl_presets[4] =
|
||||
{
|
||||
{ // 25% Shadow mask, 50% Scanlines, 3% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation
|
||||
true,
|
||||
0.25f, { "adapture-grill.png" }, 6, 6, 0.1875f, 0.1875f, 0.0f, 0.0f,
|
||||
0.03f, 0.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.5f, 1.0f, 0.5f, 1.0f, 0.0f, 0.0f,
|
||||
{ 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 1.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 1.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 1.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, 1.0f },
|
||||
{ 0.9f, 0.9f, 0.9f },
|
||||
{ 0.05f,0.05f,0.05f},
|
||||
{ 0.25f,0.25f,0.25f},
|
||||
1.2f,
|
||||
false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0,
|
||||
0.9f, 4.0f,
|
||||
1.0f,
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
0.21f, 0.19f, 0.17f, 0.15f, 0.14f, 0.13f, 0.12f, 0.11f, 0.10f, 0.09f
|
||||
},
|
||||
{ // 25% Shadow mask, 0% Scanlines, 3% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation
|
||||
true,
|
||||
0.25f, { "adapture-grill.png" }, 6, 6, 0.1875f, 0.1875f, 0.0f, 0.0f,
|
||||
0.03f, 0.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.5f, 1.0f, 0.0f, 0.0f,
|
||||
{ 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 1.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 1.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 1.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, 1.0f },
|
||||
{ 0.9f, 0.9f, 0.9f },
|
||||
{ 0.05f,0.05f,0.05f},
|
||||
{ 0.25f,0.25f,0.25f},
|
||||
1.2f,
|
||||
false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0,
|
||||
0.9f, 4.0f,
|
||||
1.0f,
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
0.21f, 0.19f, 0.17f, 0.15f, 0.14f, 0.13f, 0.12f, 0.11f, 0.10f, 0.09f
|
||||
},
|
||||
{ // 25% Shadow mask, 0% Scanlines, 0% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation
|
||||
true,
|
||||
0.25f, { "adapture-grill.png" }, 6, 6, 0.1875f, 0.1875f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.5f, 1.0f, 0.0f, 0.0f,
|
||||
{ 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 1.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 1.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 1.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, 1.0f },
|
||||
{ 0.9f, 0.9f, 0.9f },
|
||||
{ 0.05f,0.05f,0.05f},
|
||||
{ 0.25f,0.25f,0.25f},
|
||||
1.2f,
|
||||
false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0,
|
||||
0.9f, 4.0f,
|
||||
1.0f,
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
0.21f, 0.19f, 0.17f, 0.15f, 0.14f, 0.13f, 0.12f, 0.11f, 0.10f, 0.09f
|
||||
},
|
||||
{ // 25% Shadow mask, 100% Scanlines, 15% Pincushion, 3 defocus, 24-degree Tint Out, 1.5 Exponent, 5% Floor, 70% Phosphor Return, 80% Saturation, Bad Convergence
|
||||
true,
|
||||
0.25f, { "adapture-grill.png" }, 6, 6, 0.1875f, 0.1875f, 0.0f, 0.0f,
|
||||
0.15f, 0.0f, 0.0f, 0.0f, 0.0f,
|
||||
1.0f, 1.0f, 0.5f, 1.0f, 0.0f, 0.5f,
|
||||
{ 3.0f, 3.0f },
|
||||
{ 0.5f,-0.33f,0.7f },
|
||||
{ 0.0f,-1.0f, 0.5f },
|
||||
{ 0.0f, 0.2f, 0.3f },
|
||||
{ 0.0f, 0.2f, 0.0f },
|
||||
{ 0.8f, 0.2f, 0.0f },
|
||||
{ 0.0f, 0.8f, 0.2f},
|
||||
{ 0.2f, 0.0f, 0.8f},
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, 1.0f },
|
||||
{ 1.5f, 1.5f, 1.5f },
|
||||
{ 0.05f,0.05f,0.05f},
|
||||
{ 0.7f, 0.7f, 0.7f},
|
||||
0.8f,
|
||||
false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0,
|
||||
0.9f, 4.0f,
|
||||
1.0f,
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
0.21f, 0.19f, 0.17f, 0.15f, 0.14f, 0.13f, 0.12f, 0.11f, 0.10f, 0.09f
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
//============================================================
|
||||
// PROTOTYPES
|
||||
//============================================================
|
||||
|
||||
static void get_vector(const char *data, int count, float *out, int report_error);
|
||||
static void get_vector(const char *data, int count, float *out, bool report_error);
|
||||
|
||||
|
||||
//============================================================
|
||||
@ -176,21 +72,18 @@ static direct3dx9_loadeffect_ptr g_load_effect = NULL;
|
||||
// shader manager constructor
|
||||
//============================================================
|
||||
|
||||
shaders::shaders():
|
||||
shaders::shaders() :
|
||||
d3dintf(NULL), machine(NULL), d3d(NULL), num_screens(0), curr_screen(0), curr_frame(0), write_ini(false), read_ini(false), hlsl_prescale_x(0), hlsl_prescale_y(0), bloom_count(0),
|
||||
vecbuf_type(), vecbuf_index(0), vecbuf_count(0), avi_output_file(NULL), avi_frame(0), avi_copy_surface(NULL), avi_copy_texture(NULL), avi_final_target(NULL), avi_final_texture(NULL),
|
||||
black_surface(NULL), black_texture(NULL), render_snap(false), snap_rendered(false), snap_copy_target(NULL), snap_copy_texture(NULL), snap_target(NULL), snap_texture(NULL),
|
||||
snap_width(0), snap_height(0), lines_pending(false), backbuffer(NULL), curr_effect(NULL), default_effect(NULL), prescale_effect(NULL), post_effect(NULL), distortion_effect(NULL),
|
||||
focus_effect(NULL), phosphor_effect(NULL), deconverge_effect(NULL), color_effect(NULL), yiq_encode_effect(NULL), yiq_decode_effect(NULL), bloom_effect(NULL),
|
||||
downsample_effect(NULL), vector_effect(NULL), fsfx_vertices(NULL), curr_texture(NULL), curr_render_target(NULL), curr_poly(NULL)
|
||||
|
||||
{
|
||||
master_enable = false;
|
||||
vector_enable = true;
|
||||
prescale_size_x = 1;
|
||||
prescale_size_y = 1;
|
||||
prescale_force_x = 0;
|
||||
prescale_force_y = 0;
|
||||
hlsl_prescale_x = 1;
|
||||
hlsl_prescale_x = 1;
|
||||
preset = -1;
|
||||
shadow_texture = NULL;
|
||||
options = NULL;
|
||||
@ -208,7 +101,12 @@ shaders::shaders():
|
||||
|
||||
shaders::~shaders()
|
||||
{
|
||||
global_free(options);
|
||||
if (options != NULL)
|
||||
{
|
||||
last_options = *options;
|
||||
}
|
||||
options = NULL;
|
||||
|
||||
cache_target *currcache = cachehead;
|
||||
while(cachehead != NULL)
|
||||
{
|
||||
@ -524,24 +422,38 @@ void shaders::toggle()
|
||||
{
|
||||
if (initialized)
|
||||
{
|
||||
// free shader resources before renderer resources
|
||||
delete_resources(false);
|
||||
|
||||
g_slider_list = NULL;
|
||||
}
|
||||
|
||||
master_enable = !master_enable;
|
||||
|
||||
// free shader resources and re-create
|
||||
d3d->device_delete_resources();
|
||||
d3d->device_create_resources();
|
||||
}
|
||||
else
|
||||
{
|
||||
master_enable = !master_enable;
|
||||
|
||||
// free shader resources and re-create
|
||||
d3d->device_delete_resources();
|
||||
d3d->device_create_resources();
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
master_enable = !master_enable;
|
||||
// re-create shader resources after renderer resources
|
||||
bool failed = create_resources(false);
|
||||
if (failed)
|
||||
{
|
||||
master_enable = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
master_enable = !master_enable;
|
||||
else
|
||||
{
|
||||
g_slider_list = init_slider_list();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -742,6 +654,11 @@ void shaders::set_texture(texture_info *texture)
|
||||
|
||||
void shaders::init(base *d3dintf, running_machine *machine, d3d::renderer *renderer)
|
||||
{
|
||||
if (&machine->system() == &GAME_NAME(___empty))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!d3dintf->post_fx_available)
|
||||
{
|
||||
return;
|
||||
@ -758,32 +675,24 @@ void shaders::init(base *d3dintf, running_machine *machine, d3d::renderer *rende
|
||||
this->d3dintf = d3dintf;
|
||||
this->machine = machine;
|
||||
this->d3d = renderer;
|
||||
|
||||
master_enable = downcast<windows_options &>(machine->options()).d3d_hlsl_enable();
|
||||
prescale_size_x = 1;
|
||||
prescale_size_y = 1;
|
||||
preset = downcast<windows_options &>(machine->options()).d3d_hlsl_preset();
|
||||
if (preset < -1 || preset > 3)
|
||||
{
|
||||
preset = -1;
|
||||
}
|
||||
|
||||
snap_width = downcast<windows_options &>(machine->options()).d3d_snap_width();
|
||||
snap_height = downcast<windows_options &>(machine->options()).d3d_snap_height();
|
||||
prescale_force_x = 0;
|
||||
prescale_force_y = 0;
|
||||
this->options = renderer->get_shaders_options();
|
||||
|
||||
windows_options &winoptions = downcast<windows_options &>(machine->options());
|
||||
|
||||
options = (hlsl_options*)global_alloc_clear(hlsl_options);
|
||||
master_enable = winoptions.d3d_hlsl_enable();
|
||||
hlsl_prescale_x = winoptions.d3d_hlsl_prescale_x();
|
||||
hlsl_prescale_y = winoptions.d3d_hlsl_prescale_y();
|
||||
snap_width = winoptions.d3d_snap_width();
|
||||
snap_height = winoptions.d3d_snap_height();
|
||||
|
||||
options->params_dirty = true;
|
||||
strcpy(options->shadow_mask_texture, downcast<windows_options &>(machine->options()).screen_shadow_mask_texture()); // unsafe
|
||||
|
||||
prescale_force_x = winoptions.d3d_hlsl_prescale_x();
|
||||
prescale_force_y = winoptions.d3d_hlsl_prescale_y();
|
||||
if (preset == -1)
|
||||
if (last_options.params_init)
|
||||
{
|
||||
options = &last_options;
|
||||
}
|
||||
|
||||
if (!options->params_init)
|
||||
{
|
||||
strncpy(options->shadow_mask_texture, winoptions.screen_shadow_mask_texture(), sizeof(options->shadow_mask_texture));
|
||||
options->shadow_mask_alpha = winoptions.screen_shadow_mask_alpha();
|
||||
options->shadow_mask_count_x = winoptions.screen_shadow_mask_count_x();
|
||||
options->shadow_mask_count_y = winoptions.screen_shadow_mask_count_y();
|
||||
@ -816,39 +725,36 @@ void shaders::init(base *d3dintf, running_machine *machine, d3d::renderer *rende
|
||||
get_vector(winoptions.screen_floor(), 3, options->floor, TRUE);
|
||||
get_vector(winoptions.screen_phosphor(), 3, options->phosphor, TRUE);
|
||||
options->saturation = winoptions.screen_saturation();
|
||||
}
|
||||
else
|
||||
{
|
||||
options = &s_hlsl_presets[preset];
|
||||
}
|
||||
options->yiq_enable = winoptions.screen_yiq_enable();
|
||||
options->yiq_cc = winoptions.screen_yiq_cc();
|
||||
options->yiq_a = winoptions.screen_yiq_a();
|
||||
options->yiq_b = winoptions.screen_yiq_b();
|
||||
options->yiq_o = winoptions.screen_yiq_o();
|
||||
options->yiq_p = winoptions.screen_yiq_p();
|
||||
options->yiq_n = winoptions.screen_yiq_n();
|
||||
options->yiq_y = winoptions.screen_yiq_y();
|
||||
options->yiq_i = winoptions.screen_yiq_i();
|
||||
options->yiq_q = winoptions.screen_yiq_q();
|
||||
options->yiq_scan_time = winoptions.screen_yiq_scan_time();
|
||||
options->yiq_phase_count = winoptions.screen_yiq_phase_count();
|
||||
options->vector_length_scale = winoptions.screen_vector_length_scale();
|
||||
options->vector_length_ratio = winoptions.screen_vector_length_ratio();
|
||||
options->bloom_scale = winoptions.screen_bloom_scale();
|
||||
get_vector(winoptions.screen_bloom_overdrive(), 3, options->bloom_overdrive, TRUE);
|
||||
options->bloom_level0_weight = winoptions.screen_bloom_lvl0_weight();
|
||||
options->bloom_level1_weight = winoptions.screen_bloom_lvl1_weight();
|
||||
options->bloom_level2_weight = winoptions.screen_bloom_lvl2_weight();
|
||||
options->bloom_level3_weight = winoptions.screen_bloom_lvl3_weight();
|
||||
options->bloom_level4_weight = winoptions.screen_bloom_lvl4_weight();
|
||||
options->bloom_level5_weight = winoptions.screen_bloom_lvl5_weight();
|
||||
options->bloom_level6_weight = winoptions.screen_bloom_lvl6_weight();
|
||||
options->bloom_level7_weight = winoptions.screen_bloom_lvl7_weight();
|
||||
options->bloom_level8_weight = winoptions.screen_bloom_lvl8_weight();
|
||||
options->bloom_level9_weight = winoptions.screen_bloom_lvl9_weight();
|
||||
options->bloom_level10_weight = winoptions.screen_bloom_lvl10_weight();
|
||||
|
||||
options->yiq_enable = winoptions.screen_yiq_enable();
|
||||
options->yiq_cc = winoptions.screen_yiq_cc();
|
||||
options->yiq_a = winoptions.screen_yiq_a();
|
||||
options->yiq_b = winoptions.screen_yiq_b();
|
||||
options->yiq_o = winoptions.screen_yiq_o();
|
||||
options->yiq_p = winoptions.screen_yiq_p();
|
||||
options->yiq_n = winoptions.screen_yiq_n();
|
||||
options->yiq_y = winoptions.screen_yiq_y();
|
||||
options->yiq_i = winoptions.screen_yiq_i();
|
||||
options->yiq_q = winoptions.screen_yiq_q();
|
||||
options->yiq_scan_time = winoptions.screen_yiq_scan_time();
|
||||
options->yiq_phase_count = winoptions.screen_yiq_phase_count();
|
||||
options->vector_length_scale = winoptions.screen_vector_length_scale();
|
||||
options->vector_length_ratio = winoptions.screen_vector_length_ratio();
|
||||
options->bloom_scale = winoptions.screen_bloom_scale();
|
||||
get_vector(winoptions.screen_bloom_overdrive(), 3, options->bloom_overdrive, TRUE);
|
||||
options->bloom_level0_weight = winoptions.screen_bloom_lvl0_weight();
|
||||
options->bloom_level1_weight = winoptions.screen_bloom_lvl1_weight();
|
||||
options->bloom_level2_weight = winoptions.screen_bloom_lvl2_weight();
|
||||
options->bloom_level3_weight = winoptions.screen_bloom_lvl3_weight();
|
||||
options->bloom_level4_weight = winoptions.screen_bloom_lvl4_weight();
|
||||
options->bloom_level5_weight = winoptions.screen_bloom_lvl5_weight();
|
||||
options->bloom_level6_weight = winoptions.screen_bloom_lvl6_weight();
|
||||
options->bloom_level7_weight = winoptions.screen_bloom_lvl7_weight();
|
||||
options->bloom_level8_weight = winoptions.screen_bloom_lvl8_weight();
|
||||
options->bloom_level9_weight = winoptions.screen_bloom_lvl9_weight();
|
||||
options->bloom_level10_weight = winoptions.screen_bloom_lvl10_weight();
|
||||
options->params_init = true;
|
||||
}
|
||||
|
||||
options->params_dirty = true;
|
||||
|
||||
@ -1071,7 +977,6 @@ int shaders::create_resources(bool reset)
|
||||
color_effect->add_uniform("Saturation", uniform::UT_FLOAT, uniform::CU_COLOR_SATURATION);
|
||||
|
||||
prescale_effect->add_uniform("ScreenDims", uniform::UT_VEC2, uniform::CU_SCREEN_DIMS);
|
||||
prescale_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS);
|
||||
|
||||
deconverge_effect->add_uniform("ScreenDims", uniform::UT_VEC2, uniform::CU_SCREEN_DIMS);
|
||||
deconverge_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS);
|
||||
@ -1095,7 +1000,7 @@ int shaders::create_resources(bool reset)
|
||||
bloom_effect->add_uniform("TargetDims", uniform::UT_VEC2, uniform::CU_TARGET_DIMS);
|
||||
|
||||
post_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS);
|
||||
post_effect->add_uniform("SourceRect", uniform::UT_VEC2, uniform::CU_SOURCE_RECT); // backward compatibility
|
||||
post_effect->add_uniform("SourceRect", uniform::UT_VEC2, uniform::CU_SOURCE_RECT);
|
||||
post_effect->add_uniform("ScreenDims", uniform::UT_VEC2, uniform::CU_SCREEN_DIMS);
|
||||
post_effect->add_uniform("TargetDims", uniform::UT_VEC2, uniform::CU_TARGET_DIMS);
|
||||
post_effect->add_uniform("QuadDims", uniform::UT_VEC2, uniform::CU_QUAD_DIMS); // backward compatibility
|
||||
@ -1461,7 +1366,9 @@ int shaders::post_pass(render_target *rt, int source_index, poly_info *poly, int
|
||||
texture_info *texture = poly->get_texture();
|
||||
|
||||
bool prepare_vector =
|
||||
PRIMFLAG_GET_VECTORBUF(poly->get_flags()) && vector_enable;
|
||||
(machine->first_screen()->screen_type() & SCREEN_TYPE_VECTOR) == SCREEN_TYPE_VECTOR;
|
||||
bool prepare_raster =
|
||||
(machine->first_screen()->screen_type() & SCREEN_TYPE_RASTER) == SCREEN_TYPE_RASTER;
|
||||
bool orientation_swap_xy =
|
||||
(d3d->window().machine().system().flags & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY;
|
||||
bool rotation_swap_xy =
|
||||
@ -1476,16 +1383,35 @@ int shaders::post_pass(render_target *rt, int source_index, poly_info *poly, int
|
||||
? 3
|
||||
: 0;
|
||||
|
||||
screen_device_iterator screen_iterator(machine->root_device());
|
||||
screen_device *screen = screen_iterator.first();
|
||||
for (int i = 0; i < curr_screen; i++)
|
||||
{
|
||||
screen = screen_iterator.next();
|
||||
}
|
||||
render_container &screen_container = screen->container();
|
||||
|
||||
float xscale = screen_container.xscale();
|
||||
float yscale = screen_container.yscale();
|
||||
float xoffset = -screen_container.xoffset();
|
||||
float yoffset = -screen_container.yoffset();
|
||||
|
||||
float screen_scale[2] = { xscale, yscale };
|
||||
float screen_offset[2] = { xoffset, yoffset };
|
||||
|
||||
curr_effect = post_effect;
|
||||
curr_effect->update_uniforms();
|
||||
curr_effect->set_texture("ShadowTexture", shadow_texture == NULL ? NULL : shadow_texture->get_finaltex());
|
||||
curr_effect->set_texture("DiffuseTexture", rt->prescale_texture[next_index]);
|
||||
curr_effect->set_vector("ScreenScale", 2, screen_scale);
|
||||
curr_effect->set_vector("ScreenOffset", 2, screen_offset);
|
||||
curr_effect->set_float("ScanlineOffset", texture->get_cur_frame() == 0 ? 0.0f : options->scanline_offset);
|
||||
curr_effect->set_bool("OrientationSwapXY", orientation_swap_xy);
|
||||
curr_effect->set_bool("RotationSwapXY", rotation_swap_xy);
|
||||
curr_effect->set_int("RotationType", rotation_type); // backward compatibility
|
||||
curr_effect->set_bool("PrepareBloom", prepare_bloom);
|
||||
curr_effect->set_bool("PrepareVector", prepare_vector);
|
||||
curr_effect->set_bool("PrepareRaster", prepare_raster);
|
||||
|
||||
next_index = rt->next_index(next_index);
|
||||
blit(prepare_bloom ? rt->native_target[next_index] : rt->prescale_target[next_index], true, poly->get_type(), vertnum, poly->get_count());
|
||||
@ -1498,7 +1424,7 @@ int shaders::downsample_pass(render_target *rt, int source_index, poly_info *pol
|
||||
int next_index = source_index;
|
||||
|
||||
bool prepare_vector =
|
||||
PRIMFLAG_GET_VECTORBUF(poly->get_flags()) && vector_enable;
|
||||
(machine->first_screen()->screen_type() & SCREEN_TYPE_VECTOR) == SCREEN_TYPE_VECTOR;
|
||||
float bloom_rescale = options->bloom_scale;
|
||||
|
||||
// skip downsample if no influencing settings
|
||||
@ -1702,7 +1628,8 @@ int shaders::screen_pass(render_target *rt, int source_index, poly_info *poly, i
|
||||
{
|
||||
int next_index = source_index;
|
||||
|
||||
bool prepare_vector = PRIMFLAG_GET_VECTORBUF(poly->get_flags()) && vector_enable;
|
||||
bool prepare_vector =
|
||||
(machine->first_screen()->screen_type() & SCREEN_TYPE_VECTOR) == SCREEN_TYPE_VECTOR;
|
||||
|
||||
curr_effect = default_effect;
|
||||
curr_effect->update_uniforms();
|
||||
@ -1756,6 +1683,8 @@ void shaders::render_quad(poly_info *poly, int vertnum)
|
||||
|
||||
if (PRIMFLAG_GET_SCREENTEX(d3d->get_last_texture_flags()) && curr_texture != NULL)
|
||||
{
|
||||
curr_screen = curr_screen < num_screens ? curr_screen : 0;
|
||||
|
||||
curr_render_target = find_render_target(curr_texture);
|
||||
|
||||
render_target *rt = curr_render_target;
|
||||
@ -1797,6 +1726,8 @@ void shaders::render_quad(poly_info *poly, int vertnum)
|
||||
curr_texture->mask_frame_count(options->yiq_phase_count);
|
||||
|
||||
options->params_dirty = false;
|
||||
|
||||
curr_screen++;
|
||||
}
|
||||
else if (PRIMFLAG_GET_VECTOR(poly->get_flags()) && vector_enable)
|
||||
{
|
||||
@ -2063,9 +1994,6 @@ bool shaders::register_texture(texture_info *texture)
|
||||
|
||||
enumerate_screens();
|
||||
|
||||
hlsl_prescale_x = prescale_force_x;
|
||||
hlsl_prescale_y = prescale_force_y;
|
||||
|
||||
// Find the nearest prescale factor that is over our screen size
|
||||
if (hlsl_prescale_x == 0)
|
||||
{
|
||||
@ -2245,7 +2173,7 @@ void shaders::delete_resources(bool reset)
|
||||
// get_vector
|
||||
//============================================================
|
||||
|
||||
static void get_vector(const char *data, int count, float *out, int report_error)
|
||||
static void get_vector(const char *data, int count, float *out, bool report_error)
|
||||
{
|
||||
if (count > 3 &&
|
||||
sscanf(data, "%f,%f,%f,%f", &out[0], &out[1], &out[2], &out[3]) < 4 && report_error)
|
||||
@ -2270,11 +2198,11 @@ static void get_vector(const char *data, int count, float *out, int report_error
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
slider_alloc - allocate a new slider entry
|
||||
currently duplicated from ui.c, this could
|
||||
be done in a more ideal way.
|
||||
-------------------------------------------------*/
|
||||
//============================================================
|
||||
// slider_alloc - allocate a new slider entry
|
||||
// currently duplicated from ui.c, this could
|
||||
// be done in a more ideal way.
|
||||
//============================================================
|
||||
|
||||
static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
|
||||
{
|
||||
@ -2774,90 +2702,92 @@ static INT32 slider_bloom_lvl10_scale(running_machine &machine, void *arg, std::
|
||||
return slider_set(&(((hlsl_options*)arg)->bloom_level10_weight), 0.01f, "%1.2f", str, newval);
|
||||
}
|
||||
|
||||
hlsl_options shaders::last_options = { false };
|
||||
|
||||
shaders::slider_desc shaders::s_sliders[] =
|
||||
{
|
||||
{ "Vector Length Attenuation", 0, 50, 100, 1, 2, slider_vector_attenuation },
|
||||
{ "Vector Attenuation Length Limit", 1, 500, 1000, 1, 2, slider_vector_length_max },
|
||||
{ "Shadow Mask Darkness", 0, 0, 100, 1, 7, slider_shadow_mask_alpha },
|
||||
{ "Shadow Mask X Count", 1, 1, 1024, 1, 7, slider_shadow_mask_x_count },
|
||||
{ "Shadow Mask Y Count", 1, 1, 1024, 1, 7, slider_shadow_mask_y_count },
|
||||
{ "Shadow Mask Pixel Count X", 1, 1, 64, 1, 7, slider_shadow_mask_usize },
|
||||
{ "Shadow Mask Pixel Count Y", 1, 1, 64, 1, 7, slider_shadow_mask_vsize },
|
||||
{ "Shadow Mask Offset X", -100, 0, 100, 1, 7, slider_shadow_mask_uoffset },
|
||||
{ "Shadow Mask Offset Y", -100, 0, 100, 1, 7, slider_shadow_mask_voffset },
|
||||
{ "Screen Curvature", 0, 0, 100, 1, 7, slider_curvature },
|
||||
{ "Screen Round Corner", 0, 0, 100, 1, 7, slider_round_corner },
|
||||
{ "Screen Smooth Border", 0, 0, 100, 1, 7, slider_smooth_border },
|
||||
{ "Screen Reflection", 0, 0, 100, 1, 7, slider_reflection },
|
||||
{ "Image Vignetting", 0, 0, 100, 1, 7, slider_vignetting },
|
||||
{ "Scanline Darkness", 0, 0, 100, 1, 1, slider_scanline_alpha },
|
||||
{ "Scanline Screen Height", 1, 20, 80, 1, 1, slider_scanline_scale },
|
||||
{ "Scanline Indiv. Height", 1, 20, 80, 1, 1, slider_scanline_height },
|
||||
{ "Scanline Brightness", 0, 20, 40, 1, 1, slider_scanline_bright_scale },
|
||||
{ "Scanline Brightness Overdrive", 0, 0, 20, 1, 1, slider_scanline_bright_offset },
|
||||
{ "Scanline Jitter", 0, 0, 40, 1, 1, slider_scanline_offset },
|
||||
{ "Defocus X", 0, 0, 64, 1, 3, slider_defocus_x },
|
||||
{ "Defocus Y", 0, 0, 64, 1, 3, slider_defocus_y },
|
||||
{ "Red Position Offset X", -1500, 0, 1500, 1, 3, slider_red_converge_x },
|
||||
{ "Red Position Offset Y", -1500, 0, 1500, 1, 3, slider_red_converge_y },
|
||||
{ "Green Position Offset X", -1500, 0, 1500, 1, 3, slider_green_converge_x },
|
||||
{ "Green Position Offset Y", -1500, 0, 1500, 1, 3, slider_green_converge_y },
|
||||
{ "Blue Position Offset X", -1500, 0, 1500, 1, 3, slider_blue_converge_x },
|
||||
{ "Blue Position Offset Y", -1500, 0, 1500, 1, 3, slider_blue_converge_y },
|
||||
{ "Red Convergence X", -1500, 0, 1500, 1, 3, slider_red_radial_converge_x },
|
||||
{ "Red Convergence Y", -1500, 0, 1500, 1, 3, slider_red_radial_converge_y },
|
||||
{ "Green Convergence X", -1500, 0, 1500, 1, 3, slider_green_radial_converge_x },
|
||||
{ "Green Convergence Y", -1500, 0, 1500, 1, 3, slider_green_radial_converge_y },
|
||||
{ "Blue Convergence X", -1500, 0, 1500, 1, 3, slider_blue_radial_converge_x },
|
||||
{ "Blue Convergence Y", -1500, 0, 1500, 1, 3, slider_blue_radial_converge_y },
|
||||
{ "Red Output from Red Input", -400, 0, 400, 5, 7, slider_red_from_r },
|
||||
{ "Red Output from Green Input", -400, 0, 400, 5, 7, slider_red_from_g },
|
||||
{ "Red Output from Blue Input", -400, 0, 400, 5, 7, slider_red_from_b },
|
||||
{ "Green Output from Red Input", -400, 0, 400, 5, 7, slider_green_from_r },
|
||||
{ "Green Output from Green Input", -400, 0, 400, 5, 7, slider_green_from_g },
|
||||
{ "Green Output from Blue Input", -400, 0, 400, 5, 7, slider_green_from_b },
|
||||
{ "Blue Output from Red Input", -400, 0, 400, 5, 7, slider_blue_from_r },
|
||||
{ "Blue Output from Green Input", -400, 0, 400, 5, 7, slider_blue_from_g },
|
||||
{ "Blue Output from Blue Input", -400, 0, 400, 5, 7, slider_blue_from_b },
|
||||
{ "Saturation", 0, 100, 400, 1, 7, slider_saturation },
|
||||
{ "Red DC Offset", -100, 0, 100, 1, 7, slider_red_offset },
|
||||
{ "Green DC Offset", -100, 0, 100, 1, 7, slider_green_offset },
|
||||
{ "Blue DC Offset", -100, 0, 100, 1, 7, slider_blue_offset },
|
||||
{ "Red Scale", -200, 100, 200, 1, 7, slider_red_scale },
|
||||
{ "Green Scale", -200, 100, 200, 1, 7, slider_green_scale },
|
||||
{ "Blue Scale", -200, 100, 200, 1, 7, slider_blue_scale },
|
||||
{ "Red Gamma", -80, 0, 80, 1, 7, slider_red_power },
|
||||
{ "Green Gamma", -80, 0, 80, 1, 7, slider_green_power },
|
||||
{ "Blue Gamma", -80, 0, 80, 1, 7, slider_blue_power },
|
||||
{ "Red Floor", 0, 0, 100, 1, 7, slider_red_floor },
|
||||
{ "Green Floor", 0, 0, 100, 1, 7, slider_green_floor },
|
||||
{ "Blue Floor", 0, 0, 100, 1, 7, slider_blue_floor },
|
||||
{ "Red Phosphor Life", 0, 0, 100, 1, 7, slider_red_phosphor_life },
|
||||
{ "Green Phosphor Life", 0, 0, 100, 1, 7, slider_green_phosphor_life },
|
||||
{ "Blue Phosphor Life", 0, 0, 100, 1, 7, slider_blue_phosphor_life },
|
||||
{ "Bloom Scale", 0, 0, 2000, 5, 7, slider_bloom_scale },
|
||||
{ "Bloom Red Overdrive", 0, 0, 2000, 5, 7, slider_bloom_red_overdrive },
|
||||
{ "Bloom Green Overdrive", 0, 0, 2000, 5, 7, slider_bloom_green_overdrive },
|
||||
{ "Bloom Blue Overdrive", 0, 0, 2000, 5, 7, slider_bloom_blue_overdrive },
|
||||
{ "Bloom Level 0 Scale", 0, 100, 100, 1, 7, slider_bloom_lvl0_scale },
|
||||
{ "Bloom Level 1 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl1_scale },
|
||||
{ "Bloom Level 2 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl2_scale },
|
||||
{ "Bloom Level 3 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl3_scale },
|
||||
{ "Bloom Level 4 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl4_scale },
|
||||
{ "Bloom Level 5 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl5_scale },
|
||||
{ "Bloom Level 6 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl6_scale },
|
||||
{ "Bloom Level 7 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl7_scale },
|
||||
{ "Bloom Level 8 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl8_scale },
|
||||
{ "Bloom Level 9 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl9_scale },
|
||||
{ "Bloom Level 10 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl10_scale },
|
||||
{ NULL, 0, 0, 0, 0, 0, NULL },
|
||||
};
|
||||
|
||||
|
||||
//============================================================
|
||||
// init_slider_list
|
||||
//============================================================
|
||||
|
||||
shaders::slider_desc shaders::s_sliders[] =
|
||||
{
|
||||
{ "Shadow Mask Darkness", 0, 0, 100, 1, slider_shadow_mask_alpha },
|
||||
{ "Shadow Mask X Count", 1, 6, 1024, 1, slider_shadow_mask_x_count },
|
||||
{ "Shadow Mask Y Count", 1, 6, 1024, 1, slider_shadow_mask_y_count },
|
||||
{ "Shadow Mask Pixel Count X", 1, 6, 64, 1, slider_shadow_mask_usize },
|
||||
{ "Shadow Mask Pixel Count Y", 1, 6, 64, 1, slider_shadow_mask_vsize },
|
||||
{ "Shadow Mask Offset X", -100, 0, 100, 1, slider_shadow_mask_uoffset },
|
||||
{ "Shadow Mask Offset Y", -100, 0, 100, 1, slider_shadow_mask_voffset },
|
||||
{ "Screen Curvature", 0, 0, 100, 1, slider_curvature },
|
||||
{ "Screen Round Corner", 0, 0, 100, 1, slider_round_corner },
|
||||
{ "Screen Smooth Border", 0, 0, 100, 1, slider_smooth_border },
|
||||
{ "Screen Reflection", 0, 0, 100, 1, slider_reflection },
|
||||
{ "Image Vignetting", 0, 0, 100, 1, slider_vignetting },
|
||||
{ "Scanline Darkness", 0, 100, 100, 1, slider_scanline_alpha },
|
||||
{ "Scanline Screen Height", 1, 20, 80, 1, slider_scanline_scale },
|
||||
{ "Scanline Indiv. Height", 1, 20, 80, 1, slider_scanline_height },
|
||||
{ "Scanline Brightness", 0, 20, 40, 1, slider_scanline_bright_scale },
|
||||
{ "Scanline Brightness Overdrive", 0, 0, 20, 1, slider_scanline_bright_offset },
|
||||
{ "Scanline Jitter", 0, 0, 40, 1, slider_scanline_offset },
|
||||
{ "Defocus X", 0, 0, 64, 1, slider_defocus_x },
|
||||
{ "Defocus Y", 0, 0, 64, 1, slider_defocus_y },
|
||||
{ "Red Position Offset X", -1500, 3, 1500, 1, slider_red_converge_x },
|
||||
{ "Red Position Offset Y", -1500, 0, 1500, 1, slider_red_converge_y },
|
||||
{ "Green Position Offset X", -1500, 0, 1500, 1, slider_green_converge_x },
|
||||
{ "Green Position Offset Y", -1500, 3, 1500, 1, slider_green_converge_y },
|
||||
{ "Blue Position Offset X", -1500, 3, 1500, 1, slider_blue_converge_x },
|
||||
{ "Blue Position Offset Y", -1500, 3, 1500, 1, slider_blue_converge_y },
|
||||
{ "Red Convergence X", -1500, 0, 1500, 1, slider_red_radial_converge_x },
|
||||
{ "Red Convergence Y", -1500, 0, 1500, 1, slider_red_radial_converge_y },
|
||||
{ "Green Convergence X", -1500, 0, 1500, 1, slider_green_radial_converge_x },
|
||||
{ "Green Convergence Y", -1500, 0, 1500, 1, slider_green_radial_converge_y },
|
||||
{ "Blue Convergence X", -1500, 0, 1500, 1, slider_blue_radial_converge_x },
|
||||
{ "Blue Convergence Y", -1500, 0, 1500, 1, slider_blue_radial_converge_y },
|
||||
{ "Red Output from Red Input", -400, 0, 400, 5, slider_red_from_r },
|
||||
{ "Red Output from Green Input", -400, 0, 400, 5, slider_red_from_g },
|
||||
{ "Red Output from Blue Input", -400, 0, 400, 5, slider_red_from_b },
|
||||
{ "Green Output from Red Input", -400, 0, 400, 5, slider_green_from_r },
|
||||
{ "Green Output from Green Input", -400, 0, 400, 5, slider_green_from_g },
|
||||
{ "Green Output from Blue Input", -400, 0, 400, 5, slider_green_from_b },
|
||||
{ "Blue Output from Red Input", -400, 0, 400, 5, slider_blue_from_r },
|
||||
{ "Blue Output from Green Input", -400, 0, 400, 5, slider_blue_from_g },
|
||||
{ "Blue Output from Blue Input", -400, 0, 400, 5, slider_blue_from_b },
|
||||
{ "Saturation", 0, 140, 400, 1, slider_saturation },
|
||||
{ "Red DC Offset", -100, 0, 100, 1, slider_red_offset },
|
||||
{ "Green DC Offset", -100, 0, 100, 1, slider_green_offset },
|
||||
{ "Blue DC Offset", -100, 0, 100, 1, slider_blue_offset },
|
||||
{ "Red Scale", -200, 95, 200, 1, slider_red_scale },
|
||||
{ "Green Scale", -200, 95, 200, 1, slider_green_scale },
|
||||
{ "Blue Scale", -200, 95, 200, 1, slider_blue_scale },
|
||||
{ "Red Gamma", -80, 16, 80, 1, slider_red_power },
|
||||
{ "Green Gamma", -80, 16, 80, 1, slider_green_power },
|
||||
{ "Blue Gamma", -80, 16, 80, 1, slider_blue_power },
|
||||
{ "Red Floor", 0, 5, 100, 1, slider_red_floor },
|
||||
{ "Green Floor", 0, 5, 100, 1, slider_green_floor },
|
||||
{ "Blue Floor", 0, 5, 100, 1, slider_blue_floor },
|
||||
{ "Red Phosphor Life", 0, 40, 100, 1, slider_red_phosphor_life },
|
||||
{ "Green Phosphor Life", 0, 40, 100, 1, slider_green_phosphor_life },
|
||||
{ "Blue Phosphor Life", 0, 40, 100, 1, slider_blue_phosphor_life },
|
||||
{ "Vector Length Attenuation", 0, 80, 100, 1, slider_vector_attenuation },
|
||||
{ "Vector Attenuation Length Limit", 1, 500, 1000, 1, slider_vector_length_max },
|
||||
{ "Bloom Scale", 0, 250, 2000, 5, slider_bloom_scale },
|
||||
{ "Bloom Red Overdrive", 0, 250, 2000, 5, slider_bloom_red_overdrive },
|
||||
{ "Bloom Green Overdrive", 0, 250, 2000, 5, slider_bloom_green_overdrive },
|
||||
{ "Bloom Blue Overdrive", 0, 250, 2000, 5, slider_bloom_blue_overdrive },
|
||||
{ "Bloom Level 0 Scale", 0, 100, 100, 1, slider_bloom_lvl0_scale },
|
||||
{ "Bloom Level 1 Scale", 0, 21, 100, 1, slider_bloom_lvl1_scale },
|
||||
{ "Bloom Level 2 Scale", 0, 19, 100, 1, slider_bloom_lvl2_scale },
|
||||
{ "Bloom Level 3 Scale", 0, 17, 100, 1, slider_bloom_lvl3_scale },
|
||||
{ "Bloom Level 4 Scale", 0, 15, 100, 1, slider_bloom_lvl4_scale },
|
||||
{ "Bloom Level 5 Scale", 0, 14, 100, 1, slider_bloom_lvl5_scale },
|
||||
{ "Bloom Level 6 Scale", 0, 13, 100, 1, slider_bloom_lvl6_scale },
|
||||
{ "Bloom Level 7 Scale", 0, 12, 100, 1, slider_bloom_lvl7_scale },
|
||||
{ "Bloom Level 8 Scale", 0, 11, 100, 1, slider_bloom_lvl8_scale },
|
||||
{ "Bloom Level 9 Scale", 0, 10, 100, 1, slider_bloom_lvl9_scale },
|
||||
{ "Bloom Level 10 Scale", 0, 9, 100, 1, slider_bloom_lvl10_scale },
|
||||
{ NULL, 0, 0, 0, 0, NULL },
|
||||
};
|
||||
|
||||
slider_state *shaders::init_slider_list()
|
||||
{
|
||||
if (!master_enable || !d3dintf->post_fx_available)
|
||||
@ -2872,8 +2802,15 @@ slider_state *shaders::init_slider_list()
|
||||
for (int index = 0; s_sliders[index].name != NULL; index++)
|
||||
{
|
||||
slider_desc *slider = &s_sliders[index];
|
||||
*tailptr = slider_alloc(*machine, slider->name, slider->minval, slider->defval, slider->maxval, slider->step, slider->adjustor, (void*)options);
|
||||
tailptr = &(*tailptr)->next;
|
||||
|
||||
int screen_type = machine->first_screen()->screen_type();
|
||||
if ((screen_type == SCREEN_TYPE_VECTOR && (slider->screen_type & SLIDER_SCREEN_TYPE_VECTOR) == SLIDER_SCREEN_TYPE_VECTOR) ||
|
||||
(screen_type == SCREEN_TYPE_RASTER && (slider->screen_type & SLIDER_SCREEN_TYPE_RASTER) == SLIDER_SCREEN_TYPE_RASTER) ||
|
||||
(screen_type == SCREEN_TYPE_LCD && (slider->screen_type & SLIDER_SCREEN_TYPE_LCD) == SLIDER_SCREEN_TYPE_LCD))
|
||||
{
|
||||
*tailptr = slider_alloc(*machine, slider->name, slider->minval, slider->defval, slider->maxval, slider->step, slider->adjustor, (void*)options);
|
||||
tailptr = &(*tailptr)->next;
|
||||
}
|
||||
}
|
||||
|
||||
return listhead;
|
||||
|
@ -186,6 +186,7 @@ class renderer;
|
||||
/* in the future this will be moved into an OSD/emu shared buffer */
|
||||
struct hlsl_options
|
||||
{
|
||||
bool params_init;
|
||||
bool params_dirty;
|
||||
float shadow_mask_alpha;
|
||||
char shadow_mask_texture[1024];
|
||||
@ -309,6 +310,14 @@ public:
|
||||
// slider-related functions
|
||||
slider_state *init_slider_list();
|
||||
|
||||
enum slider_screen_type
|
||||
{
|
||||
SLIDER_SCREEN_TYPE_NONE = 0,
|
||||
SLIDER_SCREEN_TYPE_RASTER = 1,
|
||||
SLIDER_SCREEN_TYPE_VECTOR = 2,
|
||||
SLIDER_SCREEN_TYPE_LCD = 4
|
||||
};
|
||||
|
||||
struct slider_desc
|
||||
{
|
||||
const char * name;
|
||||
@ -316,6 +325,7 @@ public:
|
||||
int defval;
|
||||
int maxval;
|
||||
int step;
|
||||
int screen_type;
|
||||
INT32(*adjustor)(running_machine &, void *, std::string *, INT32);
|
||||
};
|
||||
|
||||
@ -362,10 +372,6 @@ private:
|
||||
int lastidx; // index of the last-encountered target
|
||||
bool write_ini; // enable external ini saving
|
||||
bool read_ini; // enable external ini loading
|
||||
int prescale_force_x; // prescale force x
|
||||
int prescale_force_y; // prescale force y
|
||||
int prescale_size_x; // prescale size x
|
||||
int prescale_size_y; // prescale size y
|
||||
int hlsl_prescale_x; // hlsl prescale x
|
||||
int hlsl_prescale_y; // hlsl prescale y
|
||||
float bloom_dims[11][2]; // bloom texture dimensions
|
||||
@ -373,7 +379,7 @@ private:
|
||||
int preset; // preset, if relevant
|
||||
bitmap_argb32 shadow_bitmap; // shadow mask bitmap for post-processing shader
|
||||
texture_info * shadow_texture; // shadow mask texture for post-processing shader
|
||||
hlsl_options * options; // current uniform state
|
||||
hlsl_options * options; // current options
|
||||
D3DPRIMITIVETYPE vecbuf_type;
|
||||
UINT32 vecbuf_index;
|
||||
UINT32 vecbuf_count;
|
||||
@ -424,13 +430,11 @@ private:
|
||||
texture_info * curr_texture;
|
||||
render_target * curr_render_target;
|
||||
poly_info * curr_poly;
|
||||
|
||||
public:
|
||||
render_target * targethead;
|
||||
cache_target * cachehead;
|
||||
|
||||
static slider_desc s_sliders[];
|
||||
static hlsl_options s_hlsl_presets[4];
|
||||
static hlsl_options last_options; // last used options
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -245,6 +245,10 @@ render_primitive_list *d3d::renderer::get_primitives()
|
||||
window().target()->set_bounds(rect_width(&client), rect_height(&client), window().aspect());
|
||||
window().target()->set_max_update_rate((get_refresh() == 0) ? get_origmode().RefreshRate : get_refresh());
|
||||
}
|
||||
if (m_shaders != NULL)
|
||||
{
|
||||
window().target()->set_transform_primitives(!m_shaders->enabled());
|
||||
}
|
||||
return &window().target()->get_primitives();
|
||||
}
|
||||
|
||||
@ -615,7 +619,7 @@ renderer::renderer(osd_window *window)
|
||||
: osd_renderer(window, FLAG_NONE), m_adapter(0), m_width(0), m_height(0), m_refresh(0), m_create_error_count(0), m_device(NULL), m_gamma_supported(0), m_pixformat(),
|
||||
m_vertexbuf(NULL), m_lockedbuf(NULL), m_numverts(0), m_vectorbatch(NULL), m_batchindex(0), m_numpolys(0), m_restarting(false), m_mod2x_supported(0), m_mod4x_supported(0),
|
||||
m_screen_format(), m_last_texture(NULL), m_last_texture_flags(0), m_last_blendenable(0), m_last_blendop(0), m_last_blendsrc(0), m_last_blenddst(0), m_last_filter(0),
|
||||
m_last_wrap(), m_last_modmode(0), m_hlsl_buf(NULL), m_shaders(NULL), m_texture_manager(NULL), m_line_count(0)
|
||||
m_last_wrap(), m_last_modmode(0), m_hlsl_buf(NULL), m_shaders(NULL), m_shaders_options(NULL), m_texture_manager(NULL), m_line_count(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -643,10 +647,6 @@ int renderer::pre_window_draw_check()
|
||||
{
|
||||
m_shaders->toggle();
|
||||
|
||||
// free all existing resources and re-create
|
||||
device_delete_resources();
|
||||
device_create_resources();
|
||||
|
||||
m_restarting = false;
|
||||
}
|
||||
|
||||
@ -796,7 +796,16 @@ int renderer::device_create(HWND device_hwnd)
|
||||
{
|
||||
// if a device exists, free it
|
||||
if (m_device != NULL)
|
||||
{
|
||||
device_delete();
|
||||
}
|
||||
|
||||
// create shader options only once
|
||||
if (m_shaders_options == NULL)
|
||||
{
|
||||
m_shaders_options = (hlsl_options*)global_alloc_clear(hlsl_options);
|
||||
m_shaders_options->params_init = false;
|
||||
}
|
||||
|
||||
// verify the caps
|
||||
int verify = device_verify_caps();
|
||||
@ -806,7 +815,9 @@ int renderer::device_create(HWND device_hwnd)
|
||||
return 1;
|
||||
}
|
||||
if (verify == 1)
|
||||
{
|
||||
osd_printf_warning("Warning: Device may not perform well for Direct3D rendering\n");
|
||||
}
|
||||
|
||||
// verify texture formats
|
||||
HRESULT result = (*d3dintf->d3d.check_device_format)(d3dintf, m_adapter, D3DDEVTYPE_HAL, m_pixformat, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8);
|
||||
@ -987,6 +998,12 @@ int renderer::device_create_resources()
|
||||
|
||||
renderer::~renderer()
|
||||
{
|
||||
if (m_shaders_options != NULL)
|
||||
{
|
||||
global_free(m_shaders_options);
|
||||
}
|
||||
m_shaders_options = NULL;
|
||||
|
||||
device_delete();
|
||||
}
|
||||
|
||||
@ -1043,8 +1060,7 @@ int renderer::device_verify_caps()
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
m_shaders = global_alloc_clear(shaders);
|
||||
// FIXME: Dynamic cast
|
||||
m_shaders = (shaders*)global_alloc_clear(shaders);
|
||||
m_shaders->init(d3dintf, &window().machine(), this);
|
||||
|
||||
DWORD tempcaps;
|
||||
|
@ -178,6 +178,7 @@ public:
|
||||
texture_info * get_vector_texture() { return m_texture_manager->get_vector_texture(); }
|
||||
|
||||
shaders * get_shaders() { return m_shaders; }
|
||||
hlsl_options * get_shaders_options() { return m_shaders_options; }
|
||||
|
||||
private:
|
||||
int m_adapter; // ordinal adapter number
|
||||
@ -220,6 +221,7 @@ private:
|
||||
|
||||
void * m_hlsl_buf; // HLSL vertex data
|
||||
shaders * m_shaders; // HLSL interface
|
||||
hlsl_options * m_shaders_options; // HLSL options
|
||||
|
||||
texture_manager * m_texture_manager; // texture manager
|
||||
|
||||
|
@ -269,108 +269,107 @@ const options_entry windows_options::s_option_entries[] =
|
||||
// performance options
|
||||
{ NULL, NULL, OPTION_HEADER, "WINDOWS PERFORMANCE OPTIONS" },
|
||||
{ WINOPTION_PRIORITY "(-15-1)", "0", OPTION_INTEGER, "thread priority for the main game thread; range from -15 to 1" },
|
||||
{ WINOPTION_PROFILE, "0", OPTION_INTEGER, "enable profiling, specifying the stack depth to track" },
|
||||
{ WINOPTION_PROFILE, "0", OPTION_INTEGER, "enables profiling, specifying the stack depth to track" },
|
||||
|
||||
// video options
|
||||
{ NULL, NULL, OPTION_HEADER, "WINDOWS VIDEO OPTIONS" },
|
||||
{ WINOPTION_MENU, "0", OPTION_BOOLEAN, "enable menu bar if available by UI implementation" },
|
||||
{ WINOPTION_MENU, "0", OPTION_BOOLEAN, "enables menu bar if available by UI implementation" },
|
||||
|
||||
// DirectDraw-specific options
|
||||
{ NULL, NULL, OPTION_HEADER, "DIRECTDRAW-SPECIFIC OPTIONS" },
|
||||
{ WINOPTION_HWSTRETCH ";hws", "1", OPTION_BOOLEAN, "enable hardware stretching" },
|
||||
{ WINOPTION_HWSTRETCH ";hws", "1", OPTION_BOOLEAN, "enables hardware stretching" },
|
||||
|
||||
// post-processing options
|
||||
{ NULL, NULL, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enable HLSL post-processing (PS3.0 required)" },
|
||||
{ WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" },
|
||||
{ WINOPTION_HLSL_PRESCALE_X, "0", OPTION_INTEGER, "HLSL pre-scale override factor for X (0 for auto)" },
|
||||
{ WINOPTION_HLSL_PRESCALE_Y, "0", OPTION_INTEGER, "HLSL pre-scale override factor for Y (0 for auto)" },
|
||||
{ WINOPTION_HLSL_PRESET";(-1-3)", "-1", OPTION_INTEGER, "HLSL preset to use (0-3)" },
|
||||
{ WINOPTION_HLSL_WRITE, NULL, OPTION_STRING, "enable HLSL AVI writing (huge disk bandwidth suggested)" },
|
||||
{ WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" },
|
||||
{ WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" },
|
||||
{ WINOPTION_SHADOW_MASK_ALPHA";fs_shadwa(0.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask alpha-blend value (1.0 is fully blended, 0.0 is no mask)" },
|
||||
{ WINOPTION_SHADOW_MASK_TEXTURE";fs_shadwt(0.0-1.0)", "aperture.png", OPTION_STRING, "shadow mask texture name" },
|
||||
{ WINOPTION_SHADOW_MASK_COUNT_X";fs_shadww", "6", OPTION_INTEGER, "shadow mask width, in phosphor dots" },
|
||||
{ WINOPTION_SHADOW_MASK_COUNT_Y";fs_shadwh", "6", OPTION_INTEGER, "shadow mask height, in phosphor dots" },
|
||||
{ WINOPTION_SHADOW_MASK_USIZE";fs_shadwu(0.0-1.0)", "0.1875", OPTION_FLOAT, "shadow mask texture size in U direction" },
|
||||
{ WINOPTION_SHADOW_MASK_VSIZE";fs_shadwv(0.0-1.0)", "0.1875", OPTION_FLOAT, "shadow mask texture size in V direction" },
|
||||
{ WINOPTION_SHADOW_MASK_UOFFSET";fs_shadwou(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset in U direction" },
|
||||
{ WINOPTION_SHADOW_MASK_VOFFSET";fs_shadwov(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset in V direction" },
|
||||
{ WINOPTION_CURVATURE";fs_curv(0.0-1.0)", "0.0", OPTION_FLOAT, "screen curvature amount" },
|
||||
{ WINOPTION_ROUND_CORNER";fs_rndc(0.0-1.0)", "0.0", OPTION_FLOAT, "screen round corner amount" },
|
||||
{ WINOPTION_SMOOTH_BORDER";fs_smob(0.0-1.0)", "0.0", OPTION_FLOAT, "screen smooth border amount" },
|
||||
{ WINOPTION_REFLECTION";fs_ref(0.0-1.0)", "0.0", OPTION_FLOAT, "screen reflection amount" },
|
||||
{ WINOPTION_VIGNETTING";fs_vig(0.0-1.0)", "0.0", OPTION_FLOAT, "image vignetting amount" },
|
||||
{ NULL, NULL, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enables HLSL post-processing (PS3.0 required)" },
|
||||
{ WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" },
|
||||
{ WINOPTION_HLSL_PRESCALE_X, "0", OPTION_INTEGER, "HLSL pre-scale override factor for X (0 for auto)" },
|
||||
{ WINOPTION_HLSL_PRESCALE_Y, "0", OPTION_INTEGER, "HLSL pre-scale override factor for Y (0 for auto)" },
|
||||
{ WINOPTION_HLSL_WRITE, NULL, OPTION_STRING, "enables HLSL AVI writing (huge disk bandwidth suggested)" },
|
||||
{ WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" },
|
||||
{ WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" },
|
||||
{ WINOPTION_SHADOW_MASK_ALPHA";fs_shadwa(0.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask alpha-blend value (1.0 is fully blended, 0.0 is no mask)" },
|
||||
{ WINOPTION_SHADOW_MASK_TEXTURE";fs_shadwt(0.0-1.0)", "shadow-mask.png", OPTION_STRING, "shadow mask texture name" },
|
||||
{ WINOPTION_SHADOW_MASK_COUNT_X";fs_shadww", "6", OPTION_INTEGER, "shadow mask tile width, in screen dimensions" },
|
||||
{ WINOPTION_SHADOW_MASK_COUNT_Y";fs_shadwh", "4", OPTION_INTEGER, "shadow mask tile height, in screen dimensions" },
|
||||
{ WINOPTION_SHADOW_MASK_USIZE";fs_shadwu(0.0-1.0)", "0.1875", OPTION_FLOAT, "shadow mask texture width, in U/V dimensions" },
|
||||
{ WINOPTION_SHADOW_MASK_VSIZE";fs_shadwv(0.0-1.0)", "0.25", OPTION_FLOAT, "shadow mask texture height, in U/V dimensions" },
|
||||
{ WINOPTION_SHADOW_MASK_UOFFSET";fs_shadwou(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset, in U direction" },
|
||||
{ WINOPTION_SHADOW_MASK_VOFFSET";fs_shadwov(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset, in V direction" },
|
||||
{ WINOPTION_CURVATURE";fs_curv(0.0-1.0)", "0.0", OPTION_FLOAT, "screen curvature amount" },
|
||||
{ WINOPTION_ROUND_CORNER";fs_rndc(0.0-1.0)", "0.0", OPTION_FLOAT, "screen round corner amount" },
|
||||
{ WINOPTION_SMOOTH_BORDER";fs_smob(0.0-1.0)", "0.0", OPTION_FLOAT, "screen smooth border amount" },
|
||||
{ WINOPTION_REFLECTION";fs_ref(0.0-1.0)", "0.0", OPTION_FLOAT, "screen reflection amount" },
|
||||
{ WINOPTION_VIGNETTING";fs_vig(0.0-1.0)", "0.0", OPTION_FLOAT, "image vignetting amount" },
|
||||
/* Beam-related values below this line*/
|
||||
{ WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)", "1.0", OPTION_FLOAT, "overall alpha scaling value for scanlines" },
|
||||
{ WINOPTION_SCANLINE_SCALE";fs_scansc(0.0-4.0)", "1.0", OPTION_FLOAT, "overall height scaling value for scanlines" },
|
||||
{ WINOPTION_SCANLINE_HEIGHT";fs_scanh(0.0-4.0)", "1.0", OPTION_FLOAT, "individual height scaling value for scanlines" },
|
||||
{ WINOPTION_SCANLINE_BRIGHT_SCALE";fs_scanbs(0.0-2.0)", "1.0", OPTION_FLOAT, "overall brightness scaling value for scanlines (multiplicative)" },
|
||||
{ WINOPTION_SCANLINE_BRIGHT_OFFSET";fs_scanbo(0.0-1.0)", "0.0", OPTION_FLOAT, "overall brightness offset value for scanlines (additive)" },
|
||||
{ WINOPTION_SCANLINE_OFFSET";fs_scanjt(0.0-4.0)", "0.0", OPTION_FLOAT, "overall interlace jitter scaling value for scanlines" },
|
||||
{ WINOPTION_DEFOCUS";fs_focus", "0.0,0.0", OPTION_STRING, "overall defocus value in screen-relative coords" },
|
||||
{ WINOPTION_CONVERGE_X";fs_convx", "0.3,0.0,-0.3",OPTION_STRING, "convergence in screen-relative X direction" },
|
||||
{ WINOPTION_CONVERGE_Y";fs_convy", "0.0,0.3,-0.3",OPTION_STRING, "convergence in screen-relative Y direction" },
|
||||
{ WINOPTION_RADIAL_CONVERGE_X";fs_rconvx", "0.0,0.0,0.0",OPTION_STRING, "radial convergence in screen-relative X direction" },
|
||||
{ WINOPTION_RADIAL_CONVERGE_Y";fs_rconvy", "0.0,0.0,0.0",OPTION_STRING, "radial convergence in screen-relative Y direction" },
|
||||
{ WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)", "1.0", OPTION_FLOAT, "overall alpha scaling value for scanlines" },
|
||||
{ WINOPTION_SCANLINE_SCALE";fs_scansc(0.0-4.0)", "1.0", OPTION_FLOAT, "overall height scaling value for scanlines" },
|
||||
{ WINOPTION_SCANLINE_HEIGHT";fs_scanh(0.0-4.0)", "1.0", OPTION_FLOAT, "individual height scaling value for scanlines" },
|
||||
{ WINOPTION_SCANLINE_BRIGHT_SCALE";fs_scanbs(0.0-2.0)", "1.0", OPTION_FLOAT, "overall brightness scaling value for scanlines (multiplicative)" },
|
||||
{ WINOPTION_SCANLINE_BRIGHT_OFFSET";fs_scanbo(0.0-1.0)", "0.0", OPTION_FLOAT, "overall brightness offset value for scanlines (additive)" },
|
||||
{ WINOPTION_SCANLINE_OFFSET";fs_scanjt(0.0-4.0)", "0.0", OPTION_FLOAT, "overall interlace jitter scaling value for scanlines" },
|
||||
{ WINOPTION_DEFOCUS";fs_focus", "1.0,0.0", OPTION_STRING, "overall defocus value in screen-relative coords" },
|
||||
{ WINOPTION_CONVERGE_X";fs_convx", "0.25,0.00,-0.25", OPTION_STRING, "convergence in screen-relative X direction" },
|
||||
{ WINOPTION_CONVERGE_Y";fs_convy", "0.0,0.25,-0.25", OPTION_STRING, "convergence in screen-relative Y direction" },
|
||||
{ WINOPTION_RADIAL_CONVERGE_X";fs_rconvx", "0.0,0.0,0.0", OPTION_STRING, "radial convergence in screen-relative X direction" },
|
||||
{ WINOPTION_RADIAL_CONVERGE_Y";fs_rconvy", "0.0,0.0,0.0", OPTION_STRING, "radial convergence in screen-relative Y direction" },
|
||||
/* RGB colorspace convolution below this line */
|
||||
{ WINOPTION_RED_RATIO";fs_redratio", "1.0,0.0,0.0",OPTION_STRING, "red output signal generated by input signal" },
|
||||
{ WINOPTION_GRN_RATIO";fs_grnratio", "0.0,1.0,0.0",OPTION_STRING, "green output signal generated by input signal" },
|
||||
{ WINOPTION_BLU_RATIO";fs_bluratio", "0.0,0.0,1.0",OPTION_STRING, "blue output signal generated by input signal" },
|
||||
{ WINOPTION_SATURATION";fs_sat(0.0-4.0)", "1.4", OPTION_FLOAT, "saturation scaling value" },
|
||||
{ WINOPTION_OFFSET";fs_offset", "0.0,0.0,0.0",OPTION_STRING, "signal offset value (additive)" },
|
||||
{ WINOPTION_SCALE";fs_scale", "0.95,0.95,0.95",OPTION_STRING, "signal scaling value (multiplicative)" },
|
||||
{ WINOPTION_POWER";fs_power", "0.8,0.8,0.8",OPTION_STRING, "signal power value (exponential)" },
|
||||
{ WINOPTION_FLOOR";fs_floor", "0.05,0.05,0.05",OPTION_STRING, "signal floor level" },
|
||||
{ WINOPTION_PHOSPHOR";fs_phosphor", "0.4,0.4,0.4",OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" },
|
||||
{ WINOPTION_RED_RATIO";fs_redratio", "1.0,0.0,0.0", OPTION_STRING, "red output signal generated by input signal" },
|
||||
{ WINOPTION_GRN_RATIO";fs_grnratio", "0.0,1.0,0.0", OPTION_STRING, "green output signal generated by input signal" },
|
||||
{ WINOPTION_BLU_RATIO";fs_bluratio", "0.0,0.0,1.0", OPTION_STRING, "blue output signal generated by input signal" },
|
||||
{ WINOPTION_SATURATION";fs_sat(0.0-4.0)", "1.4", OPTION_FLOAT, "saturation scaling value" },
|
||||
{ WINOPTION_OFFSET";fs_offset", "0.0,0.0,0.0", OPTION_STRING, "signal offset value (additive)" },
|
||||
{ WINOPTION_SCALE";fs_scale", "0.95,0.95,0.95", OPTION_STRING, "signal scaling value (multiplicative)" },
|
||||
{ WINOPTION_POWER";fs_power", "0.8,0.8,0.8", OPTION_STRING, "signal power value (exponential)" },
|
||||
{ WINOPTION_FLOOR";fs_floor", "0.05,0.05,0.05", OPTION_STRING, "signal floor level" },
|
||||
{ WINOPTION_PHOSPHOR";fs_phosphor", "0.4,0.4,0.4", OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" },
|
||||
/* NTSC simulation below this line */
|
||||
{ NULL, NULL, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enable YIQ-space HLSL post-processing" },
|
||||
{ WINOPTION_YIQ_CCVALUE";yiqcc", "3.59754545",OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_BVALUE";yiqb", "0.5", OPTION_FLOAT, "B value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_OVALUE";yiqo", "1.570796325",OPTION_FLOAT, "Outgoing Color Carrier phase offset for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_PVALUE";yiqp", "1.0", OPTION_FLOAT, "Incoming Pixel Clock scaling value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_NVALUE";yiqn", "1.0", OPTION_FLOAT, "Y filter notch width for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_YVALUE";yiqy", "6.0", OPTION_FLOAT, "Y filter cutoff frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_IVALUE";yiqi", "1.2", OPTION_FLOAT, "I filter cutoff frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
|
||||
{ WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
|
||||
{ WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
|
||||
{ NULL, NULL, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enables YIQ-space HLSL post-processing" },
|
||||
{ WINOPTION_YIQ_CCVALUE";yiqcc", "3.59754545", OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_BVALUE";yiqb", "0.5", OPTION_FLOAT, "B value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_OVALUE";yiqo", "1.570796325", OPTION_FLOAT, "Outgoing Color Carrier phase offset for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_PVALUE";yiqp", "1.0", OPTION_FLOAT, "Incoming Pixel Clock scaling value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_NVALUE";yiqn", "1.0", OPTION_FLOAT, "Y filter notch width for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_YVALUE";yiqy", "6.0", OPTION_FLOAT, "Y filter cutoff frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_IVALUE";yiqi", "1.2", OPTION_FLOAT, "I filter cutoff frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
|
||||
{ WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
|
||||
{ WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
|
||||
{ WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
|
||||
/* Vector simulation below this line */
|
||||
{ NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.8", OPTION_FLOAT, "How much length affects vector fade" },
|
||||
{ WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "500.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
|
||||
{ NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.5", OPTION_FLOAT, "How much length affects vector fade" },
|
||||
{ WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "500.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
|
||||
/* Bloom below this line */
|
||||
{ NULL, NULL, OPTION_HEADER, "BLOOM POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_BLOOM_SCALE, "0.25", OPTION_FLOAT, "Intensity factor for bloom" },
|
||||
{ WINOPTION_BLOOM_OVERDRIVE, "0.0,0.0,0.0",OPTION_STRING, "Overdrive factor for bloom" },
|
||||
{ WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", OPTION_FLOAT, "Bloom level 0 (full-size target) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.21", OPTION_FLOAT, "Bloom level 1 (half-size target) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.19", OPTION_FLOAT, "Bloom level 2 (quarter-size target) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.17", OPTION_FLOAT, "Bloom level 3 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.15", OPTION_FLOAT, "Bloom level 4 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.14", OPTION_FLOAT, "Bloom level 5 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.13", OPTION_FLOAT, "Bloom level 6 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.12", OPTION_FLOAT, "Bloom level 7 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.11", OPTION_FLOAT, "Bloom level 8 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL9_WEIGHT, "0.10", OPTION_FLOAT, "Bloom level 9 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL10_WEIGHT, "0.09", OPTION_FLOAT, "Bloom level 10 (1x1 target) weight" },
|
||||
{ NULL, NULL, OPTION_HEADER, "BLOOM POST-PROCESSING OPTIONS" },
|
||||
{ WINOPTION_BLOOM_SCALE, "0.25", OPTION_FLOAT, "Intensity factor for bloom" },
|
||||
{ WINOPTION_BLOOM_OVERDRIVE, "1.0,1.0,1.0", OPTION_STRING, "Overdrive factor for bloom" },
|
||||
{ WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", OPTION_FLOAT, "Bloom level 0 (full-size target) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.64", OPTION_FLOAT, "Bloom level 1 (half-size target) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.32", OPTION_FLOAT, "Bloom level 2 (quarter-size target) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.16", OPTION_FLOAT, "Bloom level 3 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.08", OPTION_FLOAT, "Bloom level 4 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.04", OPTION_FLOAT, "Bloom level 5 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.04", OPTION_FLOAT, "Bloom level 6 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.02", OPTION_FLOAT, "Bloom level 7 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.02", OPTION_FLOAT, "Bloom level 8 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL9_WEIGHT, "0.01", OPTION_FLOAT, "Bloom level 9 (.) weight" },
|
||||
{ WINOPTION_BLOOM_LEVEL10_WEIGHT, "0.01", OPTION_FLOAT, "Bloom level 10 (1x1 target) weight" },
|
||||
|
||||
// full screen options
|
||||
{ NULL, NULL, OPTION_HEADER, "FULL SCREEN OPTIONS" },
|
||||
{ WINOPTION_TRIPLEBUFFER ";tb", "0", OPTION_BOOLEAN, "enable triple buffering" },
|
||||
{ WINOPTION_TRIPLEBUFFER ";tb", "0", OPTION_BOOLEAN, "enables triple buffering" },
|
||||
{ WINOPTION_FULLSCREENBRIGHTNESS ";fsb(0.1-2.0)", "1.0", OPTION_FLOAT, "brightness value in full screen mode" },
|
||||
{ WINOPTION_FULLSCREENCONTRAST ";fsc(0.1-2.0)", "1.0", OPTION_FLOAT, "contrast value in full screen mode" },
|
||||
{ WINOPTION_FULLSCREENGAMMA ";fsg(0.1-3.0)", "1.0", OPTION_FLOAT, "gamma value in full screen mode" },
|
||||
|
||||
// input options
|
||||
{ NULL, NULL, OPTION_HEADER, "INPUT DEVICE OPTIONS" },
|
||||
{ WINOPTION_GLOBAL_INPUTS ";global_inputs", "0", OPTION_BOOLEAN, "enable global inputs" },
|
||||
{ WINOPTION_DUAL_LIGHTGUN ";dual", "0", OPTION_BOOLEAN, "enable dual lightgun input" },
|
||||
{ WINOPTION_GLOBAL_INPUTS ";global_inputs", "0", OPTION_BOOLEAN, "enables global inputs" },
|
||||
{ WINOPTION_DUAL_LIGHTGUN ";dual", "0", OPTION_BOOLEAN, "enables dual lightgun input" },
|
||||
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -33,7 +33,6 @@
|
||||
#define WINOPTION_HLSLPATH "hlslpath"
|
||||
#define WINOPTION_HLSL_PRESCALE_X "hlsl_prescale_x"
|
||||
#define WINOPTION_HLSL_PRESCALE_Y "hlsl_prescale_y"
|
||||
#define WINOPTION_HLSL_PRESET "hlsl_preset"
|
||||
#define WINOPTION_HLSL_WRITE "hlsl_write"
|
||||
#define WINOPTION_HLSL_SNAP_WIDTH "hlsl_snap_width"
|
||||
#define WINOPTION_HLSL_SNAP_HEIGHT "hlsl_snap_height"
|
||||
@ -137,7 +136,6 @@ public:
|
||||
const char *d3d_hlsl_write() const { return value(WINOPTION_HLSL_WRITE); }
|
||||
int d3d_hlsl_prescale_x() const { return int_value(WINOPTION_HLSL_PRESCALE_X); }
|
||||
int d3d_hlsl_prescale_y() const { return int_value(WINOPTION_HLSL_PRESCALE_Y); }
|
||||
int d3d_hlsl_preset() const { return int_value(WINOPTION_HLSL_PRESET); }
|
||||
int d3d_snap_width() const { return int_value(WINOPTION_HLSL_SNAP_WIDTH); }
|
||||
int d3d_snap_height() const { return int_value(WINOPTION_HLSL_SNAP_HEIGHT); }
|
||||
float screen_shadow_mask_alpha() const { return float_value(WINOPTION_SHADOW_MASK_ALPHA); }
|
||||
|
Loading…
Reference in New Issue
Block a user