Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLSL refactoring #724

Merged
merged 27 commits into from Mar 18, 2016
Merged

HLSL refactoring #724

merged 27 commits into from Mar 18, 2016

Conversation

ImJezze
Copy link
Contributor

@ImJezze ImJezze commented Mar 15, 2016

This is quite a big update that mainly changes the size used for render targets and re-introduces the correct usage of texture coordinates instead screen coordinates by the shaders.

Refactored render targets

  • HLSL now uses NPOT sized render targets (this breaks the compatibility with graphics cards based on R300/R400/NV30, anno 2005 and older)
  • HLSL render targets now have the exact size of the screen
  • removed HLSL pre-scale factor
  • 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
  • HLSL now uses a sharp bi-linear interpolation to pre-scale textures to screen size, based on [Themaister's] implementation
  • added proper texture coordinates to vector screen quad
  • removed ./hlsl/artwork_support folder (the default shaders supports artworks again)
  • known issue: cocktail mode for vector screen looks wrong

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)
  • added scanline variation, which makes the scanline height dependent 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'

Refactored bloom

  • fixed dimensions of bloom targets, which results in a much better alignment especially for games with very low resolution (therefore current bloom settings might look a little less intense than before)
  • reduced blur width for raster screen
  • added usage of shadow u/v option for source tile mode

HLSL presets

  • added general presets for raster and vector screens
  • added example presets for Game Boy (monochrome LCD) and Game Boy Advance (color LCD)
  • options are now reset to loaded preset when game is closed

MAME Testers #6144: Fixed infinite loop

  • fixed infinite loop while building slider list, when more than one window was created

p.s. The fix for #6144 is more of a workaround, because it doesn't achieve the intended functionality, but at least the application does not freeze anymore.

- 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'
- 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)
- 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)
Resolved Conflicts:
- src/osd/modules/render/d3d/d3dhlsl.cpp
Resolved Conflicts:
- src/osd/modules/render/d3d/d3dhlsl.cpp
- src/osd/modules/render/d3d/d3dhlsl.h
- src/osd/modules/render/drawd3d.cpp
- src/osd/modules/render/drawd3d.h
- src/osd/windows/winmain.cpp
- 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
- 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
- fixed infinite loop while building slider list, when more than one
screen was created
- fixed infinite loop while building slider list, when more than one
screen was created (reverted from commit 546f7a2)
# Resolved Conflicts:
#	src/osd/modules/render/d3d/d3dhlsl.cpp
#	src/osd/windows/winmain.cpp
- added general presets for raster and vector screens
- added special presets for Game Boy (monochrome LCD) and Game Boy Advance (color LCD)
- 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
- and corrected aperture texture name
- 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
- fixed infinite loop while building slider list, when more than one
window was created
refs mametesters mamedev#6144
- added option for scanline variation
Tafoid added a commit that referenced this pull request Mar 18, 2016
@Tafoid Tafoid merged commit ba499f3 into mamedev:master Mar 18, 2016
@Tafoid
Copy link
Contributor

Tafoid commented Mar 18, 2016

Regarding the presets you added to the INI folder - should those be internal and not depend on external files? Users may already have .ini files which will be overwritten as soon as they update GIT or update the next integer release (if these stay in source) which will likely lead to very unhappy campers.

@ImJezze
Copy link
Contributor Author

ImJezze commented Mar 18, 2016

The added INI files should be included in the binary bundle. But you're right, the new files might override existing files of the user. I think it will be fine if they are moved to a sub-folder like ./ini/presets/ So people can copy and modify them without fear of losing their changes during an update.

@u-man74

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants