Commit graph

24 commits

Author SHA1 Message Date
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
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
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
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
b1f1300517 Made defocus strength equal for x/y and independent from screen size
- defocus is now independent from screen size and ratio
- horizontal and vertical defocus now have the same strength
- replaced asymmetric defocus kernel by a symmetric kernel
- defocus is now limited to a maximum of 10
- added shader uniforms for orientation and rotation settings
2015-12-20 13:57:28 +01: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
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
Miodrag Milanovic
7a2ac30275 update in agreement with ImJezze (nw) 2015-05-24 14:53:26 +02:00
Miodrag Milanovic
54e5245846 added licenses to hlsl files (nw) 2015-05-12 09:18:09 +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
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
d157249cb7 d3dhlsl.c: Add preliminary vector post-processing. [MooglyGuy] 2013-01-21 02:40:48 +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
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
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
53e20c168f Fixing multiscreen games, nwn 2011-05-22 02:27:31 +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
Ryan Holtz
f3d341a544 Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 16:55:34 +00:00