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

Authentic adaptive CRT shaders #2777

Merged
merged 32 commits into from
Aug 31, 2023
Merged

Authentic adaptive CRT shaders #2777

merged 32 commits into from
Aug 31, 2023

Commits on Aug 31, 2023

  1. Configuration menu
    Copy the full SHA
    664cee2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a7800ed View commit details
    Browse the repository at this point in the history
  3. Cleanup

    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    d25dd84 View commit details
    Browse the repository at this point in the history
  4. Remove mechanism to pass #define directives from env vars to shaders

    Remove the super obscure "extension mechanism" where #define directives
    can be passed to shaders via GLSHADER_* environment variables. This is
    originating from the original OpenGL shader SVN patch. Most likely  
    nobody uses this for anything and it just complicates the code for no
    good reason, so it's best to lose it.
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    c10a2fe View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fa3d268 View commit details
    Browse the repository at this point in the history
  6. Untangle init_shader() to make the shader loading logic composable

    Also turn 'glshader' into a string property as it can store either
    symbolic shader names or actual paths.
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    7a2fb45 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5904cfd View commit details
    Browse the repository at this point in the history
  8. Use std::string instead of string_views in sdlmain

    Replacing all uses of string_view with std::string in sdlmain.cpp as its
    use is not warranted (we're not dealing with substrings, neither
    anything performance sensitive, so 'const std::string&' is a simpler and
    more straightforward solution).
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    0fa4cad View commit details
    Browse the repository at this point in the history
  9. Add GFX_GetCanvasSize()

    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    d66b1ee View commit details
    Browse the repository at this point in the history
  10. Remove some warnings

    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    650e097 View commit details
    Browse the repository at this point in the history
  11. Clean up includes

    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    842ba86 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    98b3c4b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    06f0bac View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    f639bf7 View commit details
    Browse the repository at this point in the history
  15. Fix gitignore

    'Resources' also ignores 'contrib/resources' on case-preserving file
    systems (Windows and macOS).
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    b6ad0ad View commit details
    Browse the repository at this point in the history
  16. Add new & improved CRT shader sets

    John Novak authored and johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    73eef48 View commit details
    Browse the repository at this point in the history
  17. Remove SVN shaders from the bundled resources

    These shaders have been a constant source of confusion because:
    
    - They're not documented -- a new user wouldn't know which one to pick
      based on the cryptic shader names alone.
    - Many of them assume a specific output resolution (e.g., 4k) and look
      quite bad on 1080p, but you don't know that only looking at the
      shader's name.
    - Most of them require further tweaking to get optimal results on
      specific output resolutions.
    - Most of them don't even aim to emulate the characteristics of PC
      monitors that are quite distinct from arcade monitors, home computer
      monitors, or TV sets from the 80s/early 90s.
    
    Because of the above, we are not bundling them with future DOSBox
    Staging releases anymore; they are replaced by the new dynamic shader
    system that picks the best CRT shader variant based on the graphics
    standard in use (CGA, EGA, VGA, etc.) and the available viewport
    resolution (1080p, 1440p, 4k, etc.)
    
    These SVN shader will still be available as a separate download for
    people who want to experiment with them.
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    a16a06b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    4a603d8 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    f9f02a8 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    2ee481e View commit details
    Browse the repository at this point in the history
  21. Extract setup_drawing()

    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    015042b View commit details
    Browse the repository at this point in the history
  22. Implement adaptive CRT emulation shaders

    - All shader management code has been moved from 'render.cpp' to
      the ShaderManager.
    
    - The 'default' shader alias to 'interpolation/sharp' has been replaced
      with the 'sharp' alias.
    
    - Three new adaptive (auto-switching) CRT emulation shader modes have
      been added: 'crt-auto', 'crt-auto-machine', and 'crt-auto-arcade'.
      These modes switch dynamically between CRT shader variants depending
      on the current video mode, the graphics adapter in use, and the
      viewport resolution (see the description of the 'glshader' setting for
      further details).
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    c8c2bcd View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    62b8170 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    b8e511b View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    c8d4c19 View commit details
    Browse the repository at this point in the history
  26. Add 'auto' integer scaling mode & improve shader name mapping

    With the 'integer_scaling = auto' setting, vertical integer scaling is
    auto-enabled for adaptive CRT shaders only, and only if a CRT shader is
    actually in use, but not for the fallback 'sharp' shader.
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    0f70f30 View commit details
    Browse the repository at this point in the history
  27. Make VideoMode part of the mode-changed criteria

    After the double-scanning & pixel-doubling changes, a few video mode
    pairs became indistinguishable when only looking at the render
    parameters. E.g., the render dimensions of the 320x200 (standard BIOS
    mode 13h) and 320x400 (non-VESA Mode X variant only) modes are both
    320x400, so they were considered the same by the mode-change detection
    logic prior to this adjustment.
    
    The solution is to include the contents of the VideoMode struct in the
    mode-changed criteria (in this example, that would contain the "nominal"
    dimensions of 320x200 and 320x400, respectively).
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    0362dde View commit details
    Browse the repository at this point in the history
  28. Remove VGA_GetCurrentMode and VGA_DescribeMode

    These have been superseded by VideoMode.to_string()
    johnnovak committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    ebecec7 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    f80643b View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    2503b19 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    8e0a612 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    014024e View commit details
    Browse the repository at this point in the history