Commit Graph

131 Commits

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
fad07814a0 Correct LCD ghosting INI and slider defaults. 2017-01-03 17:03:14 -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
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
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
70a9637eb5 Simplify implementation of delta_time.
src/osd/modules/render/d3d/d3dhlsl.cpp: Move time members
calculation to shaders::begin_draw.

	src/osd/modules/render/d3d/d3dhlsl.h: Remove update_t.
2016-12-13 10:27:55 -08:00
Westley M. Martinez
40e71b93ae Add signal so that any future shaders relying on delta_time do not
interfere with each other.

	src/osd/modules/render/d3d/d3dhlsl.cpp: update_t flag is reset
for each emulated screen 0.

	src/ods/modules/render/d3d/d3dhlsl.h: Add update_t.
2016-12-12 22:34:14 -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
35035aae28 Remove iostream (used for debugging) 2016-12-11 12:11:13 -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
Miodrag Milanovic
0d87fd7cb8 Small cleanup (nw) 2016-11-11 16:12:02 +01:00
ImJezze
51a81ef3aa hlsl: fixed games with off-screen backdrop artworks
- e.g. atarifb, bowler
2016-11-02 21:39:11 +01:00
Jezze
d9ae40b9fe Reduced defocus effect to one pass (HLSL/BGFX)
- removed second defocus pass
- limited defocus stength to a maximum of 2.0
2016-10-22 22:56:16 +02:00
Jezze
ef16086fea Disabled clearing of render targets in several passes (HLSL)
- which was quite a performance overhead and not necessary because the shaders fill every texel of a target without blending
2016-10-22 22:56:16 +02:00
Jezze
390e6bd43d Refactored d3d_render_target (nw)
* removed cashe_target class
* moved cashe texture and surface to d3d_render_target class
* render targets are now created per screen not per screen texture
* removed useless creation of render targets for ui textures
2016-10-22 22:56:15 +02:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
2016-10-22 13:13:17 +02:00
Nathan Woods
85ba2fde28 Bulk renaming of Windows string conversion functions
utf8_from_[a|w|t]string ==> osd::text::from_[a|w|t]string
[a|w|t]string_from_utf8 ==> osd::text::to_[a|w|t]string
2016-10-03 23:20:25 -04:00
Vas Crabb
d7a9eeb64f use floorf rather than floor for float->float 2016-09-28 23:57:34 +10:00
Jezze
ecf1e166fc Fixed several small issues in HLSL/BGFX
* fixed target texture dimension when -intoverscan is used (this fixes the appereance of scanline and shadow mask)
* added target_scale and screen_count uniforms
* rounded corners now remain aligned with screen bounds when -intoverscan is used (single screen only)
2016-09-28 15:30:43 +02:00
Miodrag Milanovic
6f5e223853 for bool type use true and false (nw) 2016-07-31 20:02:56 +02:00
Miodrag Milanovic
185f5059fb algorithm-> utility where appropriate, fix imgtool (nw) 2016-07-31 15:37:37 +02:00
Miodrag Milanovic
9667c6a8cc std::min and std:max instead of MIN and MAX, also some more macros converted to inline functions (nw) 2016-07-31 14:41:02 +02:00
Miodrag Milanovic
4887ce1844 Cleanups and version bump 2016-07-27 09:26:22 +02:00
Nathan Woods
ab73291e47 Changed strconv.[cpp|h] functions to return their results as std::string and std::wstring 2016-07-24 22:55:00 -04:00
ImJezze
89af2864ed Fixed MT #6291
* fixed copy of texture data to bitmap in BGFX
* changed AVI dimension to a lowest integral multiple of 4
  (2 was still to low for most video players, e.g. VLC)
* added audio to AVI record in HLSL
* HLSL AVI record now uses window dimension instead of snap dimension
2016-07-16 20:54:37 +02:00
ImJezze
502e02642e Fixed dimension of high-res snapshots (Alt + 12) and AVI records (Alt + Shift + F12) when screen dimension is swapped 2016-07-16 14:42:42 +02:00
Vas Crabb
6e64e3314a Patch up d3dhlsl as well (nw) 2016-07-07 20:20:38 +10:00
Giuseppe Gorgoglione
85740d73e6 Remove bgfx_avi_name and hlsl_write options
Now the filenames for movies recorded by HLSL and BGFX renderers are automatically generated just like the ones for movies and snapshots recorded by the video core. They are generated according to the "snapname" template (eg. by default <snap_folder>/<device_name>/<numeric_index.avi>, so you can revert to the old behavior (why?) just setting "snapname  bgfx.avi" or "snapname  hlsl.avi".

The main advantage is that now you can record as many movies as you want during a single gaming session without much hassle (previously you had to move or rename the old movie file by hand before recording a new one).
2016-07-04 13:50:10 +02:00
Giuseppe Gorgoglione
2b0682196d Direct3D HLSL: use aviwrite to record avi movies
Use common infrastructure in aviwrite.c instead of equivalent local code.
In addition:
- the target textures used by the HLSL movie recorder are now allocated only when recording is ongoing
- removed shaders->begin_frame() and shaders->end_frame() hooks from the main Direct3D rendering loop
- set default HLSL movie name to hlsl.avi to match bgfx.avi setting
2016-07-04 10:48:47 +02:00
Giuseppe Gorgoglione
0312b918a8 Direct3D: convert linked lists into vectors of unique pointers 2016-07-01 01:42:29 +02:00
Giuseppe Gorgoglione
05ae871334 Misc code cleanups for Direct3D code
Removed unused methods, unused function parameters, redundant casts, doubly linked lists made into singly linked lists, etc.
2016-07-01 00:14:36 +02:00
Miodrag Milanovic
63f9a01f8c Cleanup and version bump 2016-06-29 08:34:30 +02:00
Miodrag Milanovic
f75a33f7d1 clang on windows fixes (nw) 2016-06-25 20:06:02 +02:00
ImJezze
f056b622bc Fixed crash of D3D when sliders menu is openend and resizing the window or switching between window and full screen mode 2016-06-20 00:03:43 +02:00
Brad Hughes
7f81081c6a Change two dynamic bind messages to verbose. 2016-06-17 22:01:45 -04:00
Giuseppe Gorgoglione
58dc78b6eb Introduce dynamic_module
This is a central cross-platform facility to dynamically bind functions from shared libraries.
    Updated all OSD modules to use it.
2016-06-11 20:14:09 +02:00
ImJezze
6ea15072a7 Procedural texture for vectors in HLSL
* added simple procedural texture for vectors with rounded line ends and beam smoothness
* added optional -vector_beam_smooth option
* removed -antialias option, antialiasing is now always applied, except for plain D3D
2016-06-05 23:50:44 +02:00
therealmogminer@gmail.com
63132b3d01 More slider cleanup, nw 2016-05-28 17:33:45 +02:00
Vas Crabb
87429e74d9 ui refactoring [Vas Crabb]
* move menu classes into ::ui namesapce
* reduce scope of many symbols

(first step in making UI code less rage-inducing so I can fix text input)
2016-05-27 03:00:20 +10:00
ImJezze
92c2bdf917 Normalized vector attenuation settings
- vector_length_ratio is now independent from screen size
- changed vector_length_ratio range from [0.0, 1000.0] to [0.0, 1.0]
- updated display name and description of vector_length_scale vector_length_ratio
2016-05-22 20:54:30 +02:00
ImJezze
18522bbc54 Fixed bloom target size for vector screens in full-screen mode
- this also improves the performance slightly
2016-05-22 11:01:23 +02:00
ImJezze
829641f901 Small changes to creation of render targest in HLSL (nw)
- removed unessesary recreations of non-screen-quad texture targets
- removed creation of cached targets for non-screen-quad texture
2016-05-16 23:19:17 +02:00
ImJezze
ad3525a4d4 Fixed several HLSL problems when running machines without screen (nw) 2016-05-16 23:19:16 +02:00
therealmogminer@gmail.com
b06be31dfe Move slider_state and ui_menu_item into src/frontend/mame, nw 2016-05-16 19:59:15 +02:00
ImJezze
b4b6543929 Equalized options of HLSL and BGFX HLSL chain
- removed POT texture size from shadow mask in HLSL, U/V size is now simply the percentage of the actual texture size
- adjusted display names of options
2016-05-05 20:59:33 +02:00
Miodrag Milanovic
cfee536f22 Cleanups and version bump 2016-04-27 08:13:59 +02:00
Miodrag Milanovic
c5cd671e89 fix windows compile (nw) 2016-04-26 08:09:32 +02:00
Miodrag Milanovic
9c2ef88573 Revert "Temp revert of Brad changes (nw)"
This reverts commit 5e831f6506.
2016-04-25 17:22:25 +02:00