Commit graph

25 commits

Author SHA1 Message Date
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
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
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
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
Miodrag Milanovic
54e5245846 added licenses to hlsl files (nw) 2015-05-12 09:18:09 +02: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
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
80d66bb1d6 HLSL Cleanup, no whatsnew:
- Fixed set_vector functionality and simplified shaders as a result
- Fixed HLSL presets, 0 to 3, in increasing level of terribleness
- Reduced options footprint from RGB triplets

Next plan: Separate INI writing.
2011-06-11 23:46:24 +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
796e691522 HLSL Updates: [Ryan Holtz, Bat Country Entertainment, austere, SoltanGris42]
- Added the ability to render screenshots at arbitrary resolutions.
- Added the ability to record AVI videos (albeit with no audio) at arbitrary resolutions.
- Added a 43-tap-wide FIR-based NTSC filter with tunable Y, I and Q frequency response.
- Updated scanlines to have a user-tunable pixel-height ratio in addition to the current screen-height ratio.
- Fixed a VRAM leak that was causing many dynamic-resolution drivers to run out of memory mid-run.
2011-05-30 21:10:23 +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
59d38593e8 MAMETesters bugs fixed:
- 04361: all: When using HLSL screen size not correct 

nwn: Frickin' finally...
2011-05-28 00:49:22 +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
6760f6a40c HLSL bugfxes, nwn 2011-05-24 00:23:40 +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
53e20c168f Fixing multiscreen games, nwn 2011-05-22 02:27:31 +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
2820e31451 HLSL Updates [Ryan Holtz, Bat Country Entertainment]
- Potential fix for some crashing reported by John IV
- Split color convolution and deconvergence into separate shaders for potential GPU savings down the line
- Added light and heavy variants of the color convolution shader, the former with YIQ colorspace removed
- Re-worked defocus to occur prior to shadow mask application, as it would be on a real monitor.
- Removed Edge Detection, as it was just for fun and can easily be added in by users if desired.
- Split "pincushion" into "Pincushion" and "Screen Curvature", the former affecting the only the displayed image and the latter only affecting the shadow mask.
2011-05-18 00:35:16 +00:00