Commit Graph

73 Commits (bd69d42a02b9f5e66c2a186552cbae2af5ad4ea8)

Author SHA1 Message Date
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 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 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 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
ImJezze b507dbb5fc Scanline Variation
- added option for scanline variation
2016-03-15 22:15:25 +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 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 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 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 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
ImJezze 099f547d05 Fixed HLSL for LCD screen type
- fixed wrong detection of vector screen, which meant that a LCD screen
was also detected as vector screen
- re-enabled scan-line and other CRT related sliders for LCD screens
2015-12-24 14:06:01 +01:00
ImJezze 8be53c28f0 Changed screen adjustment for HLSL
- screen adjustment (scale, offset) can now be handled by the respective
render API itself (default behavior is as before)
- D3D (if HLSL) is activated handles screen adjustment by itself within
the shader, which fixes the odd behavior of some effects (e.g. round
corners) when screen scale and offset is used
2015-11-17 19:37:56 +01:00
ImJezze 2a3bd8b8d0 Cleanup
- removed duplicate prescale fields
- made visibility of HLSL options depending on screen type
- disabled scanlines for LCD screen type
2015-11-07 12:03:36 +01:00
ImJezze 7eb83c31a5 Artwork Support
- added special post.fx and distortion.fx shader, which support enabled
artworks, but they cannot apply some of the previously implemented
corrections (e.g. bloom staircase artifacts when screen is curved,
elliptic rounded corners when aspect ratio is not 4:3)
2015-10-18 19:16:46 +02: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
ImJezze d132946c6f Vector curvature correction
- corrected vector curvature on x-axis when screen dims and render
target dims differ (there is still a difference on y-axis)
2015-07-19 12:28:51 +02:00
ImJezze 9ce2864141 Post Pass effects for Vector rendering
- added support for post pass effects for vector rendering (does not
work properly in full screen mode, yet)
- made texture_info::compute_size_subroutine() function public static
2015-07-12 23:28:38 +02:00
ImJezze be2590932b Fixed misaligned scanlines with odd resolutions
- fixed misaligned scanline with odd resolutions caused by centered
coordinates
2015-05-30 15:38:19 +02:00
David Haywood 8745daaca2 Merge pull request #190 from ImJezze/master
Changed vignetting and fixed rounded corners
2015-05-27 15:12:52 +01:00
ImJezze fe71f92dd2 Quick fix
- something was messed up on the last commit
2015-05-24 17:46:34 +02:00
ImJezze 4c04a362e2 Fixed roundness of rouned corners
- fixed roundness of rounded corners; the default aspect ratio of 4:3
should not be stretched anymore when the source has another ratio
- disabled blurring of rounded corners
- some cleanup
2015-05-24 17:23:38 +02:00
Miodrag Milanovic 7a2ac30275 update in agreement with ImJezze (nw) 2015-05-24 14:53:26 +02:00
ImJezze 0fa1503782 Changed vignetting simulation
- removed screen ratio influence
- changed radius, blur and intensity
2015-05-22 18:56:30 +02:00
ImJezze a7e221a4a7 Fixed black border
- fixed black border on the right and bottom side of the screen, caused
by the previously added rounded corners
2015-05-15 19:54:52 +02:00
Miodrag Milanovic 54e5245846 added licenses to hlsl files (nw) 2015-05-12 09:18:09 +02:00
ImJezze 3f3647eeef Fixed Curvature zoom
- fixed curvature zoom to fit the screen size in any aspect ratio
2015-05-10 15:05:19 +02:00
ImJezze 871900fe1e Fixed automatic Shadow Mask rotation
- added missing RotationSwapXY shader paramter
2015-05-09 11:51:06 +02:00
ImJezze f940c884a0 Fixed automatic Shadow Mask rotation
- fixed usage of OrientationSwapXY shader parameter
- added RotationSwapXY shader parameters to consider the user defined
screen rotation
2015-05-09 11:40:23 +02:00
ImJezze a70198a5fb HLSL shader improvements
- changed shadow mask implementation, shadow count XY now represent the
number of pixel the shadow UV sized tiles will take on the screen
- implemented rotation of the shadow mask texture depending on the
default landscape or portrait view of the screen
- removed prescale and pixel border of the shadow mask texture
- added option to change the shadow UV offset, to reduce the color
bleeding of the shadow mask
- adjusted presets to work with the changed mask implementation
- reduced defocus offset
- improved downsampling for better blurring
- improved alignment of bloom layers (raster and vector)
- applied bloom effect to the render output of screenshot and AVI
recording
- changed curvature effect to fit screen size
- changed scanlines to be not rendered into bloom layers
- changed shadow mask to be not rendered into bloom layers
- changed color floor to not light the bloom layers
- changed shadow mask to not dark the color floor
- added image vignetting simulation and option
- added round screen corner simulation and option
- added screen light reflection simulation and option
- made usage of unused brightness offset (additive)
- removed unused pincushion option
- removed duplicate shadow count Y options
- removed artwork/adapture.png
- added artwork/adapture-grill.png
- added artwork/shadow-mask.png
- added artwork/slot-mask.png
- added hlsl/simple.fx
- removed unused shaders::blit() function
- added shaders::screen_pass() function, which handles the
(raster-)rendering on screen, into screenshot and AVI recording
- added effect:set_bool() function
2015-05-03 14:41:05 +02:00
Scott Stone aa896515a0 This revert (r26927), as requested by author, fixes the regression of missing graphics for vector games using HLSL. Also reverted patch in code (r27063) to deal with "roundf" for pre-vs2013 compilers - which is no longer needed. (nw) 2014-01-24 00:30:29 +00:00
Ryan Holtz 3312b67f93 - Fix for pixel gaps between multi-screen games in HLSL mode. [MooglyGuy] 2014-01-04 03:17:31 +00:00
Ryan Holtz 8f613c115b more HLSL cleanup, part e of pi (nw) 2013-08-30 01:05:13 +00:00
Ryan Holtz ac119a8e15 uniform consolidation, nw 2013-08-29 00:56:33 +00:00
Ryan Holtz a86d35158c minor shader cleanup, nw 2013-08-28 00:36:02 +00:00
Ryan Holtz 37ce180567 -Restructured NTSC encode/decode shaders for better readability. [MooglyGuy] 2013-08-25 20:49:37 +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