Commit Graph

136 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
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 68036515ba Fixed aspect ratio of rounded corners (nw) 2016-09-29 15:19:44 +02: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
Jezze 7dc76d6501 - already fixed scanline issue also applied for swapped orientation (nw) 2016-08-13 20:30:56 +02:00
ImJezze 2f06a08ec4 Small shader corrections (nw) 2016-06-20 00:03:44 +02:00
ImJezze 758aaa496a Fixed scanlines if the screen output is less than twice the size of the host source 2016-06-06 19:40:36 +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
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 bef70746af Fixed half texel offset of 'source' shadow mask tile mode 2016-05-05 22:46:56 +02:00
ImJezze 07d8b25571 Added "selection" parameter to chain input sampler
- if specified all textures (.png) within the same directoy of the given texture will be selectable via slider in the UI
- also added slider for "shadow mask tile mode" to HLSL chain
2016-04-24 20:36:42 +02:00
ImJezze dba12a31ad Small fixes (nw)
- fixed not used u_humbar_hertz_rate parameter
- fixed half pixel shift of the shadow mask along the screen diagonal
2016-04-22 13:16:37 +02:00
ImJezze b1c06acb61 Implemented handling for u_screen_scale and u_screen_offset (nw) 2016-04-21 07:52:29 +02:00
ImJezze cd4dfca43e Refactored BGFX distortion pass (nw)
- also removed vector hack
2016-04-19 21:18:16 +02:00
ImJezze 8ed3a7d94a Refactored distortion pass
- separated curvature parameter into distortion, cubic_distortion and distort_corner
- distortion and cubic_distortion can be negative, to compensate each other
- distort_corner is intependent from the image distortion
2016-04-19 21:13:20 +02:00
ImJezze 32f0e6efac Removed hacks for vector screens from shaders (nw)
- added handling of texture coordinates for vector screens to core render
- added handling of orientation/rotation for vector screens to D3D renderer
2016-04-13 19:21:57 +02:00
therealmogminer@gmail.com a4f615a14d Get NTSC working in both bgfx and d3d, nw 2016-03-29 01:56:37 +02:00
ImJezze fe9dfdbf99 Refactored Bloom
- reduced raster bloom level to 8
- extended vector bloom level to 15
- changed vector bloom to be less blocky
- removed bloom_lvl9_weight and bloom_lvl10_weight options
2016-03-28 20:19:01 +02:00
ImJezze c731b59cbe Added oversampling option
- and some cleanup
2016-03-25 16:40:32 +01:00
ImJezze b507dbb5fc Scanline Variation
- added option for scanline variation
2016-03-15 22:15:25 +01:00
ImJezze c2d4e3c018 Cleanup (nw)
- options are reset to loaded preset when game is closed
- changed default values of options to result in no effects activated
- init_slider_list() does not returns but sets g_slider_list directly
- removed unnecessary oriented_vector_texcoords
2016-03-13 17:11:08 +01:00
ImJezze b1a392a45f Fixed mask orientation for vector screen 2016-03-12 19:17:57 +01:00
ImJezze 4c7e845498 Fixed rotated source tile mode
- and corrected aperture texture name
2016-03-12 18:59:36 +01:00
ImJezze 7add547602 Refactoring of render targes and vector texture coordinates
- implemented proper texture coordinates for vector quad primitive
- vector screen is now processed in texture coordinates
- revered workaround for raster screen, which is again processed in
texture coordinates
- known issue: cocktail mode for vector screen looks wrong
2016-03-12 16:03:28 +01:00
ImJezze 0e76ce80de Cleanup primary.fx
- split into primary.fx into 3 techniques for vector buffer, screen and
UI pass
- moved register_texture() for shaders outside of texture_info creation
- added render_primitive parameter to register_texture(); currently
unused
- removed other unused register_texture() definition
2016-02-28 18:59:10 +01:00
ImJezze 11395616dd Bloom refactoring
- calculation of bloom dimensions is now done only once, when render
target is created
- reduced blur width for non-vector screens
- implemented shadow u/v option for source tile mode
2016-02-25 20:58:49 +01:00
ImJezze e57c90084c Quality and Performance improvements
- HLSL now uses NPOT sized target surfaces (breaks compatibility with
graphics cards based on R300/R400/NV30 and older)
- HLSL target surfaces now have the size of the screen canvas
- removed HLSL pre-scale factor
- HLSL now uses a sharp bilinear interpolation to pre-scale textures to
screen canvas size, based on [Themaister's] implementation
- improved overall performance (based on the previously required
pre-scale factor, you might notice a 5-50% speed-up depending on your
graphics card, more if you used a higher pre-scale factor)
- improved shadow mask quality (pixel-perfect) in screen-mode
- fixed half source texel offset of bloom level alignment
- removed ./hlsl/artwork_support folder
- all shaders after pre-scale are now based on screen coordinate
(workaground, till both raster and vector pass can work on texture
coordinates)
- disabled distortion shader for more than one screen and for artworks
in full mode, does not affect artworks in copped mode (workaground, till
both raster and vector pass can work on texture coordinates)
- moved compute_texture_size() from texture_info to texture_manager (nw)
2016-02-20 21:58:56 +01:00
ImJezze d15d53c728 Fixed Bloom Level Alignment
- fixed target dimensions of bloom levels, which results in a much
better alignment especially for game with very low resolution (therefore
current bloom settings might look a little less intense than before)
- small cleanups (nw)
2016-02-07 13:40:24 +01:00
ImJezze f5e3032d98 Improved Scanline Simulation
- changed the amount of scanline darkness, a setting of 1.0 now becomes
fully black (to get the same result as before half your current setting)
- scanline height now depends on the brightness of the underlying color
- the amount of the scanline brightness and overdrive now depends on the
scanline darkness
- renamed 'Scanline Screen Height' to 'Scanline Screen Scale' and
'Scanline Indiv. Height' to 'Scanline Height'
2016-02-07 13:32:34 +01:00
ImJezze 8d5848718c Fixed missing const (nw) 2016-01-26 22:24:47 +01:00
ImJezze a5fb439705 Cleanup (nw) 2016-01-26 22:14:41 +01:00
ImJezze d516871e6f NTSC Refactoring and Options
- merged YIQ encode and decode pass into one NTSC pass
- added options for most NTSC settings
- reduced sample count to 64
- changed default O value to 0
- fit NTSC signal jitter between a reasonable limit of 0 and 1
- fit A and B value between a reasonable limit of -1 and 1
- fit scanline jitter between a reasonable limit of 0 and 1
- added hum bar simulation based on [MooglyGuy's] GLSL port of the mame
shader pipeline
- added monochrome-chessboard.png
- added slot-mask-aligned.png (to simulate a TFT LCD)
2016-01-25 22:02:24 +01:00
ImJezze ded9493cb0 Fixed YIQ passes
- fixed half texel offset
- readded usage of A value in encode/decode pass
- readded jitter of B value in encode/decode pass
- readded usage of P value in encode pass
- fixed not set O value uniform for decode pass
- removed duplicate YIQ option definition
- changed default of O value back to 1.0
2016-01-09 16:41:53 +01:00
ImJezze 37b596b7b4 Refactored color converge
- color converge is now independent from ratio
- the radial converge now "translates" the most outer pixel as thay
would be translated by the linar converge with the same amount
- color converge is now limited to a maximum of 10
- added color converge pass to vector rendering
2016-01-09 16:15:45 +01:00
ImJezze 1cacb7d040 Refactoring (nw)
- restructured bloom level size and weight uniforms
2016-01-03 16:20:27 +01:00
ImJezze a2c7b61daa Refactoring
- replaced shader parameters OrientationSwapXY xor RotationSwapXY by
SwapXY
- made shader parameters SourceDims, SourceRect, TargetDims, ScreenDims,
QuadDims and SwapXY available for all shaders
- color convolution, defocus and phosphor pass will now be skipped if
all influencing parameters are 0
- removed unused bloom_texture and bloom_target arrays from cache_target
class
- fixed half texel offset in prescale.fx
2015-12-31 16:59:23 +01:00
ImJezze eea40fd0e4 Cleanup (nw)
- removed unused pincushion.fx
2015-12-31 16:32:35 +01:00
ImJezze ff77b7897b Cleanup (nw)
- renamed shadow_mask_type to shadow_mask_tile_mode
- renamed bloom_type to bloom_blend_mode
- implemented "Source" shadow mask tile mode for artwork_support/post.fx
2015-12-26 12:27:07 +01:00
ImJezze 1b373eb812 Extended Shadow Mask and Bloom functionality
- added shadow mask type option to choose between "Screen" and "Source"
tile mode ("Screen" is the default as before)
- added bloom type option to choose between "Addition" and "Darken"
blend mode ("Addition" is the default as before)
- the alpha channel of a shadow mask is now filled with the background
color of the screen by the amount of the inverted alpha value
- added monochrome-matrix.png which can be used in combination with
"Source" tile mode and "Darken" blend mode to simulate a STN LCD, for
example
2015-12-25 20:02:47 +01:00