Commit graph

21 commits

Author SHA1 Message Date
Vas Crabb
54cdb214e4 hlsl: Fixed regression in distortion shader. [Ryan Holtz] 2023-02-24 17:33:05 +11:00
MooglyGuy
5671484fc8
Major D3D and BGFX code refactoring and bug fixes: (#10858) [Ryan Holtz]
* render/bgfx: Improved clearing and blending. Added prescale support. Fixes MT07586, MT07587, MT08084.
* render/bgfx: Fixed blend and tint handling. (Fixes Github #1953).
* render/bgfx/blendreader.cpp: Support non-separated blend mode specification for BGFX effects.
* render/bgfx: Reworked how horizontally-padded screen textures are handled. Likely fixes MT08512 and MT08505.
* render/bgfx: Ensure that a texture's width margin is updated in all cases.
* render/d3d/d3dhlsl.cpp: Fixed tinting in HLSL post-processing mode.
* render/d3d/d3dhlsl.cpp: Avoid most redundant state-setting calls. Reduces D3D API calls by about 90% on fruit machine drivers.
* render/d3d/d3dhlsl.cpp: Assign SourceDims and QuadDims uniforms to only those effects that use them.
* machine/laserdsc.cpp: Always add video quad to screen container, adjust tint based on m_videoenable instead.
2023-01-29 03:59:25 +11: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
ImJezze
2f06a08ec4 Small shader corrections (nw) 2016-06-20 00:03:44 +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
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
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
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
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
4610935e79 Small Fixes
- fixed position of reflection effect for vector graphics
- fixed size of rounded corners
- fixed very small black border
2015-10-20 20:07:38 +02: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
2577b29602 Cleanup
- changed default values of curvature, vignetting, reflection, round
corner and smooth border to 0
- reverted compute_size_subroutine() back to non static
- removed some test code
2015-10-18 14:35:46 +02:00
ImJezze
81c15decf8 Smooth Borders
- enabled smooth border effect and added option, its amount is limited
by the amount of rounded corners
- added raster.ini to parse_standard_inis()
- merged vector and raster bloom options, use vector.ini or raster.ini
to distinguish
2015-10-09 18:49:39 +02:00
ImJezze
5addcdd2da Small fixes
- fixed defocus strength with difference prescales
- removed default screen ratio of 4:3, ratio is now based on the screen
quad size
- reverted some space to tab changes
2015-10-04 15:57:07 +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