Commit Graph

34 Commits (master)

Author SHA1 Message Date
R. Belmont 311a56b958 Revert "New phosphor persistence shaders for HLSL" 2017-01-05 12:30:07 -05:00
Westley M. Martinez 2b95c8e50b Change cached texture format to floating point.
hlsl/phosphor.fx: Remove hacks

	ini/presets/raster.ini, ini/presets/vector-mono.ini,
ini/presets/vector.ini: Tweak presets

	src/osd/modules/render/d3d/d3dcomm.h,
src/osd/modules/render/d3d/d3dhlsl.cpp,
src/osd/modules/render/drawd3d.cpp: Change cache texture format to
floating point for precise for phosphor and ghosting shaders.
2017-01-04 17:44:46 -08:00
Westley M. Martinez 91172125de Add LCD ghosting shader for Direct3D
hlsl/ghosting.fx: Add LCD ghosting shader

	hlsl/phosphor.fx: Remove LCD logic

	ini/presets/gameboy.ini, ini/presets/gba.ini,
ini/presets/lcd-matrix.ini, ini/presets/lcd.ini, ini/presets/raster.ini,
ini/presets/vector.ini: Update presets

	src/osd/modules/render/d3d/d3dhlsl.cpp,
src/osd/modules/render/d3d/d3dhlsl.h: Add LCD shader and sliders.  Allow
sliders to be adjusted for R, G, and B components.

	src/osd/windows/winmain.cpp, src/osd/windows/winmain.h: Add LCD
ghosting options.# Please enter the commit message for your changes. Lines starting
2017-01-02 15:42:33 -08:00
Westley M. Martinez c7cc38199a Tweak phosphor parameter scaling, update presets. 2016-12-30 16:24:31 -08:00
Westley M. Martinez 7cda4860ec Scale and phosphor persistence sliders.
hlsl/phosphor.fx: Scale parameter into tau or gamma.

	src/osd/modules/render/d3d/d3dhlsl.cpp:
	src/osd/modules/render/d3d/d3dhlsl.h:
	src/osd/windows/winmain.cpp:
	src/osd/windows/winmain.h: Combine tau and beta sliders into one
slider labeled 'Time Constant'.
2016-12-30 15:40:30 -08:00
Westley M. Martinez b2682b7c55 Add gamma correction for proper impulse response. 2016-12-30 13:18:41 -08:00
Westley M. Martinez f1da2ecffa Remove phosphor burn-in. 2016-12-30 10:46:44 -08:00
Westley M. Martinez 43d7ab3663 Implement LCD persistence shader.
hlsl/phosphor.fx: Do LCD persistence effect using boolean LCD.
LCD persistence is monochrome and thus does not have separate components
like phosphor persistence.

	src/osd/modules/render/d3d/d3dhlsl.cpp: Add slider for LCD
games.

	src/osd/modules/render/d3d/d3dhlsl.h: (BP) Add options for LCD
games.

	src/osd/windows/winmain.cpp: (BP) Add options for LCD games.

	src/osd/windows/winmain.h: (BP) Add options for LCD games.
2016-12-29 14:57:31 -08:00
Westley M. Martinez 0b6f935443 Implement new phosphor shader.
hlsl/phosphor.fx: Make changes to the pixel shader.  New
uniforms: Mode, Tau, Beta, Gamma.  Remove Phosphor.  Mode selects the
mode for phosphor simulation: off (no decay), exponential, inverse
power.  Tau is the time constant for exp. decay.  Beta and Gamma are
constants for inv-pow.

	src/osd/modules/render/d3d/d3dhlsl.cpp: Provide uniforms and add
sliders for new options.

	src/osd/modules/render/d3d/d3dhlsl.h: (BP) Provide new options.

	src/osd/windows/winmain.cpp: (BP) Provide new options.

	src/osd/windows/winmain.h: (BP) Provide new options.
2016-12-29 14:57:28 -08:00
Westley M. Martinez 77fd0232e6 Fix phosphor shader to work properly for multi-screen games and
multi-window use.

	hlsl/phosphor.fx: Update semantics.

	src/osd/modules/render/d3d/d3dhlsl.cpp: Implement
shaders::delta_time member function.

	src/osd/modules/render/d3d/d3dhlsl.h: Add acc_t and delta_t
members for use by shaders::delta_time.  Member function returns the
amount of time since itself has been called, for use by time-dependent
shaders.
2016-12-12 22:09:59 -08:00
Westley M. Martinez eba9550c42 Fix phosphor persistence shader behavior based on time.
hlsl/phosphor.fx: Add calculation time passed to be used by
shader.

	src/osd/modules/render/d3d/d3dhlsl.cpp: Make pixel shader
calculate the current pixel by factoring in the amount of time which has
passed since the last rendering.
2016-12-11 12:01:43 -08:00
ImJezze eea40fd0e4 Cleanup (nw)
- removed unused pincushion.fx
2015-12-31 16:32:35 +01:00
ImJezze 062e6e0383 Refactoring, Fixes and Cleanup
- added distortion pass, which is applied after the bloom pass
- moved vignetting, curvature, round corners and reflection effect to
distortion pass
- disabled distortion pass for multi screens and activated artworks due
to not yet fixed misalignments
- disabled scanlines for vector rendering in post pass shader
- removed prescale knowledge from downsample, bloom and post pass shader
- fixed half pixel offset in most shaders
- fixed position of reflection effect when screen is rotated or flipped
- fixed roundness of round corners in any aspect ratio
- fixed shadow mask bleeding (nearly completly)
- added bounds() and screen_bounds() getter to layout_view
- added current_view() getter to render_target
- some cleanup and refactoring
2015-09-26 18:22:51 +02:00
ImJezze 37f6ff0b65 Refactoring and Fixes
- removed position offset in post.fx
- fixed texture offset caused by 0th level of bloom.fx
- fixed texture offset caused by focus.fx
- changed Passthrough parameter in phosphor.fx to boolean
- simplified defocus pass function and calling it twice
- removed CU_PHOSPHOR_IGNORE (Passthrough) uniform, which was only used
in phosphor pass function and is now directly set
- added CU_TARGET_DIMS (TargetDims) uniform based on the current render
target
- fixed missing Prescal parameter in downsample pass function
- some code cleanup
2015-08-02 17:31:54 +02:00
Miodrag Milanovic 54e5245846 added licenses to hlsl files (nw) 2015-05-12 09:18:09 +02:00
Ryan Holtz 8f613c115b more HLSL cleanup, part e of pi (nw) 2013-08-30 01:05:13 +00:00
Ryan Holtz a86d35158c minor shader cleanup, nw 2013-08-28 00:36:02 +00:00
Ryan Holtz 35ef098e64 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
2013-05-22 01:58:38 +00:00
Ryan Holtz e028e20476 - "And he did give them CRT bloom, and it scorched their eyes so; and they wept
openly, for there was nothing left to see with" [MooglyGuy]
  * Enabled vector bloom and associated .ini controls
  * Added raster bloom and associated .ini controls, each bloom "level" is the
    linear weight of successively half-sized render targets
  * Removed D3D8 mode
  * Mass renaming in D3D renderer to use namespaces, initial planning step to
    HAL-based renderer implementation on Windows (i.e., GL on Windows)
  * Converted d3d_info, d3d_poly_info, and d3d_texture_info into classes
  * Added batching of vectors for possible speed increase
  * Minor cleanup of shader state setting
2013-05-19 16:21:26 +00:00
Ryan Holtz aa19b2633c (nw) Fixed sliders and phosphor offset 2013-02-28 05:22:14 +00:00
Ryan Holtz d157249cb7 d3dhlsl.c: Add preliminary vector post-processing. [MooglyGuy] 2013-01-21 02:40:48 +00:00
Ryan Holtz 4523bfa2d0 HLSL "Hurricain't Keep A Good Dev Down" Bugfix Extravaganza: [Ryan Holtz, Bat
Country Entertainment]
- Created two flags, -hlsl_ini_write and -hlsl_ini_read. The former enables
  custom HLSL INI writing explicitly, the other enables loading of the same.
- Fixed disappearing aperture effect when using custom INI files.
- Fixed diagonal seam on some games, for serious real this time
- Fixed phosphor simulation, now works as expected
2011-08-28 09:10:53 +00:00
Jonathan Gevaryahu 1246cde58c Fix hlsl phosphor decay [nimitz] 2011-07-29 15:08:32 +00:00
Ryan Holtz f42b5ccda0 No whatsnew
Attempting to fix the HLSL 'blurriness' reported by a few people. Now HLSL will auto-prescale to the nearest texture size that is greater than the target screen size on both axes and is also an even multiple of the raw bitmap's size.
2011-05-31 13:53:25 +00:00
Ryan Holtz ed6689e2d4 Fixed scanlines, nwn. This took much longer to fix than it should have. :[ 2011-05-31 05:02:17 +00:00
Ryan Holtz 37e8c1d7e4 Fixing some scanline-alignment issues. 2011-05-31 02:04:28 +00:00
Ryan Holtz 244eb4cf24 No whatnsew: Really, really, really fixed the remaining pixel alignment and UV clamping issues. Tested Gradius, Pac-Man, Mr. Do, and Stompin' with no observed issues. Gradius, in particular, is a good test case as the bottom row of its "Credits" readout lies on the bottom row of pixels, and the scrolling starfield allows visual verification of the X extents as they scroll on and off. 2011-05-28 14:14:05 +00:00
Ryan Holtz 3e437e09f0 HLSL updates, nwn:
- Favor bilinear sampling on X and point sampling on Y. Best of both worlds.
2011-05-27 23:24:53 +00:00
Ryan Holtz c8ef077d5b HLSL Updates: [Ryan Holtz, Bat Country Entertainment]
- Switched to point-sampling through most of the shader chain to avoid non-intentional pixel smearing
- Corrected alignment and scaling on the shadow mask and scanlines; dramatically reduces rainbow banding at non-oversampled resolutions.
2011-05-27 10:07:11 +00:00
Ryan Holtz e97aa6b56d Internal HLSL cleanup - removed aux texcoords, restored software vertex processing due to low-end cards not doing hardware vertex processing, removed unnecessary tristrip->trilist splitting. Restores D3D functionality on integrated chipsets and marginal cards. [Ryan Holtz, Ashura-X] 2011-05-24 18:28:54 +00:00
Ryan Holtz ae9fbbe44d NTSC fixes, nw 2011-05-23 01:53:35 +00:00
Ryan Holtz 41d1d2acdc TortoiseSVN indicates these didn't get updated, this should finally nail down the texture border pixel stretching issue, nwn 2011-05-22 03:48:13 +00:00
Ryan Holtz a47bd09534 HLSL Improvements: [Ryan Holtz, Bat Country Entertainment]
- Added magnet deconvergence via a shader uniform
- Improved phosphorescence
- Improved YIQ codec
2011-05-21 06:47:56 +00:00
Ryan Holtz f3d341a544 Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 16:55:34 +00:00