├── .editorconfig ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── Common.props ├── Doxyfile ├── FUNDING.yml ├── LICENSE.md ├── README.md ├── REFERENCE.md ├── ReShade.sln ├── ReShade.vcxproj ├── ReShade.vcxproj.filters ├── ReShadeFX.vcxproj ├── ReShadeFX.vcxproj.filters ├── ReShadeFXC.vcxproj ├── ReShadeFXC.vcxproj.filters ├── ReShadeInject.vcxproj ├── cpp.hint ├── deps ├── D3D12On7.props ├── ImGui.patch ├── ImGui.props ├── ImGui.vcxproj ├── MinHook.props ├── MinHook.vcxproj ├── MinHook.vcxproj.filters ├── OpenVR.props ├── OpenXR.props ├── SPIRV.props ├── Vulkan.props ├── Windows.props ├── d3d12on7 │ ├── LICENSE.txt │ └── include │ │ └── D3D12Downlevel.h ├── d3d911on12 │ ├── LICENSE.txt │ └── include │ │ ├── d3d11on12.h │ │ └── d3d9on12.h ├── fpng.props ├── fpng.vcxproj ├── gl3w.props ├── gl3w.vcxproj ├── imgui_config.cpp ├── imgui_config.hpp ├── openvr │ ├── LICENSE │ ├── headers │ │ └── openvr.h │ └── src │ │ └── ivrclientcore.h ├── sk_hdr_png.props ├── sk_hdr_png │ └── include │ │ └── sk_hdr_png.hpp ├── stb.props ├── stb.vcxproj ├── stb_image_dds │ └── stb_image_dds.h ├── stb_impl.c ├── utfcpp.props └── vulkan_layer │ └── vk_layer_dispatch_table.h ├── examples ├── 01-fps_limit │ ├── fps_limit.vcxproj │ └── fps_limit_addon.cpp ├── 02-freepie │ ├── freepie.vcxproj │ └── freepie_addon.cpp ├── 03-history_window │ ├── history_window.vcxproj │ └── history_window_addon.cpp ├── 04-api_trace │ ├── api_trace.vcxproj │ └── api_trace_addon.cpp ├── 05-shader_dump │ ├── shader_dump_addon.cpp │ └── shader_dump_addon.vcxproj ├── 06-shader_replace │ ├── shader_replace_addon.cpp │ └── shader_replace_addon.vcxproj ├── 07-texture_dump │ ├── texture_dump_addon.cpp │ └── texture_dump_addon.vcxproj ├── 08-texture_replace │ ├── texture_replace_addon.cpp │ └── texture_replace_addon.vcxproj ├── 09-depth │ ├── generic_depth.vcxproj │ └── generic_depth_addon.cpp ├── 10-texture_overlay │ ├── texture_overlay_addon.cpp │ └── texture_overlay_addon.vcxproj ├── 11-obs_capture │ ├── LICENSE.txt │ ├── obs_capture.cpp │ ├── obs_capture.vcxproj │ ├── obs_hook_info.cpp │ └── obs_hook_info.hpp ├── 12-video_capture │ ├── video_capture.cpp │ └── video_capture.vcxproj ├── 13-effects_during_frame │ ├── effects_during_frame.vcxproj │ └── effects_during_frame_addon.cpp ├── 14-ray_tracing │ ├── ray_tracing.vcxproj │ ├── ray_tracing.vcxproj.filters │ ├── ray_tracing_addon.cpp │ └── ray_tracing_shaders.hlsl ├── 15-effect_runtime_sync │ ├── runtime_sync.vcxproj │ └── runtime_sync_addon.cpp ├── 16-swapchain_override │ ├── swapchain_override.vcxproj │ └── swapchain_override_addon.cpp ├── 17-screenshot_to_clipboard │ ├── screenshot_to_clipboard.vcxproj │ └── screenshot_to_clipboard_addon.cpp ├── Examples.sln ├── README.md └── utils │ ├── config.hpp │ ├── crc32_hash.hpp │ ├── descriptor_tracking.cpp │ ├── descriptor_tracking.hpp │ ├── load_texture_image.cpp │ ├── save_texture_image.cpp │ ├── state_tracking.cpp │ └── state_tracking.hpp ├── include ├── reshade.hpp ├── reshade_api.hpp ├── reshade_api_device.hpp ├── reshade_api_format.hpp ├── reshade_api_pipeline.hpp ├── reshade_api_resource.hpp ├── reshade_events.hpp └── reshade_overlay.hpp ├── res ├── exports.def ├── fonts │ ├── forkawesome.h │ ├── forkawesome.ifs │ ├── forkawesome.inl │ └── glyph_ranges.hpp ├── lang_bg-BG.rc2 ├── lang_de-DE.rc2 ├── lang_en-US.rc2 ├── lang_es-ES.rc2 ├── lang_fr-FR.rc2 ├── lang_ja-JP.rc2 ├── lang_ko-KR.rc2 ├── lang_ru-RU.rc2 ├── lang_zh-CN.rc2 ├── main_icon.ico ├── main_icon.svg ├── main_icon_small.png ├── main_icon_small.svg ├── resource.h ├── resource.rc ├── shaders │ ├── copy_ps.hlsl │ ├── fullscreen_vs.hlsl │ ├── imgui_hdr.hlsl │ ├── imgui_ps_3_0.hlsl │ ├── imgui_ps_430.glsl │ ├── imgui_ps_450.glsl │ ├── imgui_ps_450.spv │ ├── imgui_ps_450_hdr.spv │ ├── imgui_ps_4_0.hlsl │ ├── imgui_vs_3_0.hlsl │ ├── imgui_vs_430.glsl │ ├── imgui_vs_450.glsl │ ├── imgui_vs_450.spv │ ├── imgui_vs_4_0.hlsl │ ├── mipmap_cs_430.glsl │ └── mipmap_cs_5_0.hlsl └── version.rc2 ├── setup ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Pages │ ├── Resources │ │ ├── DirectX.png │ │ ├── OpenGL.png │ │ ├── OpenXR.png │ │ └── Vulkan.png │ ├── SelectAddonsPage.xaml │ ├── SelectAddonsPage.xaml.cs │ ├── SelectApiPage.xaml │ ├── SelectApiPage.xaml.cs │ ├── SelectAppPage.xaml │ ├── SelectAppPage.xaml.cs │ ├── SelectEffectsPage.xaml │ ├── SelectEffectsPage.xaml.cs │ ├── SelectOperationPage.xaml │ ├── SelectOperationPage.xaml.cs │ ├── StatusPage.xaml │ └── StatusPage.xaml.cs ├── Properties │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assembly.manifest │ └── AssemblyInfo.cs.in ├── ReShade Setup.csproj ├── ReShade32.json ├── ReShade32_XR.json ├── ReShade64.json ├── ReShade64_XR.json └── Utilities │ ├── AeroGlass.cs │ ├── FileOpenDialog.cs │ ├── IniFile.cs │ └── PEInfo.cs ├── source ├── addon.cpp ├── addon.hpp ├── addon_manager.cpp ├── addon_manager.hpp ├── com_ptr.hpp ├── com_utils.hpp ├── d2d1 │ └── d2d1.cpp ├── d3d10 │ ├── d3d10.cpp │ ├── d3d10_device.cpp │ ├── d3d10_device.hpp │ ├── d3d10_impl_command_list.cpp │ ├── d3d10_impl_command_queue.cpp │ ├── d3d10_impl_device.cpp │ ├── d3d10_impl_device.hpp │ ├── d3d10_impl_state_block.cpp │ ├── d3d10_impl_state_block.hpp │ ├── d3d10_impl_swapchain.cpp │ ├── d3d10_impl_swapchain.hpp │ ├── d3d10_impl_type_convert.cpp │ ├── d3d10_impl_type_convert.hpp │ ├── d3d10_resource.cpp │ ├── d3d10_resource.hpp │ └── d3d10_resource_call_vtable.inl ├── d3d11 │ ├── d3d11.cpp │ ├── d3d11_command_list.cpp │ ├── d3d11_command_list.hpp │ ├── d3d11_device.cpp │ ├── d3d11_device.hpp │ ├── d3d11_device_context.cpp │ ├── d3d11_device_context.hpp │ ├── d3d11_impl_command_list.cpp │ ├── d3d11_impl_command_queue.cpp │ ├── d3d11_impl_device.cpp │ ├── d3d11_impl_device.hpp │ ├── d3d11_impl_device_context.hpp │ ├── d3d11_impl_state_block.cpp │ ├── d3d11_impl_state_block.hpp │ ├── d3d11_impl_swapchain.cpp │ ├── d3d11_impl_swapchain.hpp │ ├── d3d11_impl_type_convert.cpp │ ├── d3d11_impl_type_convert.hpp │ ├── d3d11_resource.cpp │ ├── d3d11_resource.hpp │ ├── d3d11_resource_call_vtable.inl │ ├── d3d11on12.cpp │ ├── d3d11on12_device.cpp │ └── d3d11on12_device.hpp ├── d3d12 │ ├── d3d12.cpp │ ├── d3d12_command_list.cpp │ ├── d3d12_command_list.hpp │ ├── d3d12_command_queue.cpp │ ├── d3d12_command_queue.hpp │ ├── d3d12_command_queue_downlevel.cpp │ ├── d3d12_command_queue_downlevel.hpp │ ├── d3d12_descriptor_heap.cpp │ ├── d3d12_descriptor_heap.hpp │ ├── d3d12_device.cpp │ ├── d3d12_device.hpp │ ├── d3d12_device_downlevel.cpp │ ├── d3d12_device_downlevel.hpp │ ├── d3d12_impl_command_list.cpp │ ├── d3d12_impl_command_list.hpp │ ├── d3d12_impl_command_list_immediate.cpp │ ├── d3d12_impl_command_list_immediate.hpp │ ├── d3d12_impl_command_queue.cpp │ ├── d3d12_impl_command_queue.hpp │ ├── d3d12_impl_device.cpp │ ├── d3d12_impl_device.hpp │ ├── d3d12_impl_swapchain.cpp │ ├── d3d12_impl_swapchain.hpp │ ├── d3d12_impl_type_convert.cpp │ ├── d3d12_impl_type_convert.hpp │ ├── d3d12_pipeline_library.cpp │ ├── d3d12_pipeline_library.hpp │ ├── d3d12_pix.cpp │ ├── d3d12_resource.cpp │ ├── d3d12_resource.hpp │ ├── d3d12_resource_call_vtable.inl │ └── descriptor_heap.hpp ├── d3d9 │ ├── d3d9.cpp │ ├── d3d9_device.cpp │ ├── d3d9_device.hpp │ ├── d3d9_impl_command_list.cpp │ ├── d3d9_impl_command_queue.cpp │ ├── d3d9_impl_device.cpp │ ├── d3d9_impl_device.hpp │ ├── d3d9_impl_state_block.cpp │ ├── d3d9_impl_state_block.hpp │ ├── d3d9_impl_swapchain.cpp │ ├── d3d9_impl_swapchain.hpp │ ├── d3d9_impl_type_convert.cpp │ ├── d3d9_impl_type_convert.hpp │ ├── d3d9_internal.cpp │ ├── d3d9_pix.cpp │ ├── d3d9_resource.cpp │ ├── d3d9_resource.hpp │ ├── d3d9_resource_call_vtable.inl │ ├── d3d9_swapchain.cpp │ ├── d3d9_swapchain.hpp │ ├── d3d9on12.cpp │ ├── d3d9on12_device.cpp │ └── d3d9on12_device.hpp ├── ddraw │ └── ddraw.cpp ├── dll_log.cpp ├── dll_log.hpp ├── dll_main.cpp ├── dll_main_test_app.cpp ├── dll_resources.cpp ├── dll_resources.hpp ├── dxgi │ ├── dxgi.cpp │ ├── dxgi_d3d10.cpp │ ├── dxgi_device.cpp │ ├── dxgi_device.hpp │ ├── dxgi_swapchain.cpp │ └── dxgi_swapchain.hpp ├── effect_codegen.hpp ├── effect_codegen_glsl.cpp ├── effect_codegen_hlsl.cpp ├── effect_codegen_spirv.cpp ├── effect_expression.cpp ├── effect_expression.hpp ├── effect_lexer.cpp ├── effect_lexer.hpp ├── effect_module.hpp ├── effect_parser.hpp ├── effect_parser_exp.cpp ├── effect_parser_stmt.cpp ├── effect_preprocessor.cpp ├── effect_preprocessor.hpp ├── effect_symbol_table.cpp ├── effect_symbol_table.hpp ├── effect_symbol_table_intrinsics.inl ├── effect_token.hpp ├── hook.cpp ├── hook.hpp ├── hook_manager.cpp ├── hook_manager.hpp ├── imgui_code_editor.cpp ├── imgui_code_editor.hpp ├── imgui_function_table.cpp ├── imgui_function_table_18600.cpp ├── imgui_function_table_18600.hpp ├── imgui_function_table_18971.cpp ├── imgui_function_table_18971.hpp ├── imgui_function_table_19000.cpp ├── imgui_function_table_19000.hpp ├── imgui_function_table_19040.cpp ├── imgui_function_table_19040.hpp ├── imgui_function_table_19180.cpp ├── imgui_function_table_19180.hpp ├── imgui_function_table_19191.cpp ├── imgui_function_table_19191.hpp ├── imgui_widgets.cpp ├── imgui_widgets.hpp ├── ini_file.cpp ├── ini_file.hpp ├── input.cpp ├── input.hpp ├── input_gamepad.cpp ├── input_gamepad.hpp ├── localization.hpp ├── lockfree_linear_map.hpp ├── moving_average.hpp ├── opengl │ ├── opengl_hooks.cpp │ ├── opengl_hooks.hpp │ ├── opengl_hooks_ffp.cpp │ ├── opengl_hooks_wgl.cpp │ ├── opengl_impl_command_list.cpp │ ├── opengl_impl_command_queue.cpp │ ├── opengl_impl_device.cpp │ ├── opengl_impl_device.hpp │ ├── opengl_impl_device_context.hpp │ ├── opengl_impl_state_block.cpp │ ├── opengl_impl_state_block.hpp │ ├── opengl_impl_swapchain.cpp │ ├── opengl_impl_swapchain.hpp │ ├── opengl_impl_type_convert.cpp │ └── opengl_impl_type_convert.hpp ├── openvr │ ├── openvr_hooks.cpp │ ├── openvr_impl_swapchain.cpp │ └── openvr_impl_swapchain.hpp ├── openxr │ ├── openxr_hooks.cpp │ ├── openxr_hooks.hpp │ ├── openxr_hooks_instance.cpp │ ├── openxr_hooks_session.cpp │ ├── openxr_impl_swapchain.cpp │ └── openxr_impl_swapchain.hpp ├── platform_utils.cpp ├── platform_utils.hpp ├── reshade_api_object_impl.hpp ├── runtime.cpp ├── runtime.hpp ├── runtime_api.cpp ├── runtime_gui.cpp ├── runtime_gui_vr.cpp ├── runtime_internal.hpp ├── runtime_manager.cpp ├── runtime_manager.hpp ├── runtime_update_check.cpp ├── state_block.cpp ├── state_block.hpp ├── vulkan │ ├── vulkan_hooks.cpp │ ├── vulkan_hooks.hpp │ ├── vulkan_hooks_cmd.cpp │ ├── vulkan_hooks_device.cpp │ ├── vulkan_hooks_instance.cpp │ ├── vulkan_impl_command_list.cpp │ ├── vulkan_impl_command_list.hpp │ ├── vulkan_impl_command_list_immediate.cpp │ ├── vulkan_impl_command_list_immediate.hpp │ ├── vulkan_impl_command_queue.cpp │ ├── vulkan_impl_command_queue.hpp │ ├── vulkan_impl_device.cpp │ ├── vulkan_impl_device.hpp │ ├── vulkan_impl_swapchain.cpp │ ├── vulkan_impl_swapchain.hpp │ ├── vulkan_impl_type_convert.cpp │ └── vulkan_impl_type_convert.hpp └── windows │ ├── dinput.cpp │ ├── dinput8.cpp │ ├── user32.cpp │ └── ws2_32.cpp └── tools ├── 7za.exe ├── create_language_template.ps1 ├── fxc.cpp ├── injector.cpp ├── update_all_languages.ps1 ├── update_imgui_function_table.ps1 └── update_version.ps1 /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | spelling_languages = en-us 5 | 6 | [*.{c,cpp,h,hpp,inl,cs,glsl,hlsl}] 7 | indent_size = 4 8 | indent_style = tab 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.{xml,xaml,manifest}] 13 | indent_size = 2 14 | indent_style = space 15 | insert_final_newline = false 16 | trim_trailing_whitespace = true 17 | 18 | [*.{c,cpp,h,hpp,inl}] 19 | cpp_generate_documentation_comments = xml 20 | cpp_indent_braces = false 21 | cpp_indent_multi_line_relative_to = statement_begin 22 | cpp_indent_within_parentheses = indent 23 | cpp_indent_preserve_within_parentheses = true 24 | cpp_indent_case_contents = true 25 | cpp_indent_case_labels = false 26 | cpp_indent_case_contents_when_block = false 27 | cpp_indent_lambda_braces_when_parameter = true 28 | cpp_indent_goto_labels = one_left 29 | cpp_indent_preprocessor = leftmost_column 30 | cpp_indent_access_specifiers = false 31 | cpp_indent_namespace_contents = true 32 | cpp_indent_preserve_comments = false 33 | cpp_new_line_before_open_brace_namespace = ignore 34 | cpp_new_line_before_open_brace_type = ignore 35 | cpp_new_line_before_open_brace_function = ignore 36 | cpp_new_line_before_open_brace_block = ignore 37 | cpp_new_line_before_open_brace_lambda = ignore 38 | cpp_new_line_scope_braces_on_separate_lines = false 39 | cpp_new_line_close_brace_same_line_empty_type = false 40 | cpp_new_line_close_brace_same_line_empty_function = false 41 | cpp_new_line_before_catch = true 42 | cpp_new_line_before_else = true 43 | cpp_new_line_before_while_in_do_while = false 44 | cpp_space_before_function_open_parenthesis = remove 45 | cpp_space_within_parameter_list_parentheses = false 46 | cpp_space_between_empty_parameter_list_parentheses = false 47 | cpp_space_after_keywords_in_control_flow_statements = true 48 | cpp_space_within_control_flow_statement_parentheses = false 49 | cpp_space_before_lambda_open_parenthesis = false 50 | cpp_space_within_cast_parentheses = false 51 | cpp_space_after_cast_close_parenthesis = false 52 | cpp_space_within_expression_parentheses = false 53 | cpp_space_before_block_open_brace = true 54 | cpp_space_between_empty_braces = false 55 | cpp_space_before_initializer_list_open_brace = true 56 | cpp_space_within_initializer_list_braces = true 57 | cpp_space_preserve_in_initializer_list = true 58 | cpp_space_before_open_square_bracket = false 59 | cpp_space_within_square_brackets = false 60 | cpp_space_before_empty_square_brackets = false 61 | cpp_space_between_empty_square_brackets = false 62 | cpp_space_group_square_brackets = true 63 | cpp_space_within_lambda_brackets = false 64 | cpp_space_between_empty_lambda_brackets = false 65 | cpp_space_before_comma = false 66 | cpp_space_after_comma = true 67 | cpp_space_remove_around_member_operators = true 68 | cpp_space_before_inheritance_colon = true 69 | cpp_space_before_constructor_colon = true 70 | cpp_space_remove_before_semicolon = true 71 | cpp_space_after_semicolon = true 72 | cpp_space_remove_around_unary_operator = true 73 | cpp_space_around_binary_operator = insert 74 | cpp_space_around_assignment_operator = insert 75 | cpp_space_pointer_reference_alignment = right 76 | cpp_space_around_ternary_operator = insert 77 | cpp_wrap_preserve_blocks = one_liners 78 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | runs-on: windows-latest 14 | 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v4 18 | with: 19 | fetch-depth: 0 20 | submodules: true 21 | 22 | - name: Set up Python 23 | uses: actions/setup-python@v5 24 | with: 25 | python-version: '3.x' 26 | 27 | - name: Set up MSBuild 28 | uses: microsoft/setup-msbuild@v2 29 | 30 | - name: Build ReShade (32-bit) 31 | run: | 32 | msbuild ReShade.sln /p:Configuration=Release /p:Platform=32-bit 33 | 34 | - name: Build ReShade (64-bit) 35 | run: | 36 | msbuild ReShade.sln /p:Configuration=Release /p:Platform=64-bit 37 | 38 | - name: Build ReShade Setup 39 | run: | 40 | msbuild ReShade.sln /p:Configuration="Release Setup" 41 | 42 | - name: Upload ReShade (32-bit) 43 | uses: actions/upload-artifact@v4 44 | with: 45 | name: ReShade (32-bit) 46 | path: './bin/Win32/Release/ReShade32.dll' 47 | 48 | - name: Upload ReShade (64-bit) 49 | uses: actions/upload-artifact@v4 50 | with: 51 | name: ReShade (64-bit) 52 | path: './bin/x64/Release/ReShade64.dll' 53 | 54 | - name: Upload ReShade Setup 55 | uses: actions/upload-artifact@v4 56 | with: 57 | name: ReShade Setup 58 | path: './bin/AnyCPU/Release/ReShade Setup.exe' 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build results 2 | [Bb]in/ 3 | [Oo]bj/ 4 | [Ii]ntermediate/ 5 | [Bb]uild/ 6 | [Dd]ebug/ 7 | [Rr]elease/ 8 | *.obj 9 | *.cso 10 | 11 | # Visual Studio cache files 12 | .vs/ 13 | ipch/ 14 | packages/ 15 | *.aps 16 | *.VC.db 17 | *.VC.opendb 18 | 19 | # Visual Studio user config files 20 | *.sdf 21 | *.opensdf 22 | *.suo 23 | *.vcxproj.user 24 | *.Args.json 25 | *.ArgsCfg.json 26 | 27 | # Visual Studio performance profiling 28 | *.vsp 29 | *.psess 30 | 31 | # Visual Studio Code 32 | .vscode/ 33 | 34 | # Code signing 35 | *.pfx 36 | *.pvk 37 | 38 | # Temporary OS files 39 | .DS_Store 40 | Thumbs.db 41 | 42 | # Versioning and setup files 43 | /res/[Vv]ersion.h 44 | /setup/*.ini 45 | /setup/Properties/AssemblyInfo.cs 46 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "imgui"] 2 | path = deps/imgui 3 | url = https://github.com/ocornut/imgui.git 4 | [submodule "minhook"] 5 | path = deps/minhook 6 | url = https://github.com/TsudaKageyu/minhook.git 7 | [submodule "stb"] 8 | path = deps/stb 9 | url = https://github.com/nothings/stb.git 10 | [submodule "gl3w"] 11 | path = deps/gl3w 12 | url = https://github.com/skaslev/gl3w.git 13 | [submodule "utfcpp"] 14 | path = deps/utfcpp 15 | url = https://github.com/nemtrif/utfcpp.git 16 | fetchRecurseSubmodules = false 17 | [submodule "spirv"] 18 | path = deps/spirv 19 | url = https://github.com/KhronosGroup/SPIRV-Headers.git 20 | [submodule "vma"] 21 | path = deps/vma 22 | url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator 23 | [submodule "vulkan"] 24 | path = deps/vulkan 25 | url = https://github.com/KhronosGroup/Vulkan-Headers.git 26 | [submodule "fpng"] 27 | path = deps/fpng 28 | url = https://github.com/richgel999/fpng 29 | [submodule "d3d12"] 30 | path = deps/d3d12 31 | url = https://github.com/microsoft/DirectX-Headers.git 32 | [submodule "openxr"] 33 | path = deps/openxr 34 | url = https://github.com/KhronosGroup/OpenXR-SDK.git 35 | -------------------------------------------------------------------------------- /Common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $(SolutionDir)bin\$(Platform)\$(Configuration)\ 6 | $(SolutionDir)intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ 7 | 8 | 9 | -------------------------------------------------------------------------------- /Doxyfile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = "ReShade" 2 | PROJECT_BRIEF = "A generic post-processing injector for games and video software." 3 | PROJECT_LOGO = ./res/main_icon_small.png 4 | 5 | INPUT = ./include ./REFERENCE.md 6 | EXCLUDE = ./include/imgui.h ./include/reshade_overlay.hpp 7 | FILE_PATTERNS = *.c *.cpp *.h *.hpp *.inl 8 | EXCLUDE_SYMBOLS = addon_event_traits 9 | USE_MDFILE_AS_MAINPAGE = ./REFERENCE.md 10 | 11 | OUTPUT_DIRECTORY = ./build 12 | 13 | GENERATE_XML = YES 14 | GENERATE_HTML = YES 15 | GENERATE_LATEX = NO 16 | 17 | SHOW_USED_FILES = YES 18 | SHOW_FILES = YES 19 | SHOW_NAMESPACES = YES 20 | MAX_INITIALIZER_LINES = 0 21 | 22 | # Parser configuration 23 | 24 | EXTRACT_ALL = YES 25 | EXTRACT_STATIC = YES 26 | 27 | # Preprocessor configuration 28 | 29 | ENABLE_PREPROCESSING = YES 30 | MACRO_EXPANSION = YES 31 | PREDEFINED = __declspec(x)= 32 | SKIP_FUNCTION_MACROS = YES 33 | -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: crosire 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2014 Patrick Mours. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 7 | * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /ReShadeFX.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ReShadeFXC.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cpp.hint: -------------------------------------------------------------------------------- 1 | // ReShade.vcxproj 2 | 3 | #define VR_Interface_Impl(type, method_name, vtable_index, interface_version, impl, return_type, ...) static return_type type##_##method_name##_##interface_version(vr::type *pThis, ##__VA_ARGS__) {} 4 | 5 | // ReShadeFX.vcxproj 6 | 7 | #define DEFINE_INTRINSIC(name, i, ret_type, ...) 8 | #define IMPLEMENT_INTRINSIC_GLSL(name, i, code) 9 | #define IMPLEMENT_INTRINSIC_HLSL(name, i, code) 10 | #define IMPLEMENT_INTRINSIC_SPIRV(name, i, code) 11 | -------------------------------------------------------------------------------- /deps/D3D12On7.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | $(SolutionDir)deps\bin\$(Configuration);$(ExecutablePath) 6 | 7 | 8 | 9 | $(SolutionDir)deps\d3d12on7\include;%(AdditionalIncludeDirectories) 10 | 11 | 12 | -------------------------------------------------------------------------------- /deps/ImGui.patch: -------------------------------------------------------------------------------- 1 | diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp 2 | --- a/imgui_widgets.cpp 3 | +++ b/imgui_widgets.cpp 4 | @@ -7110,8 +7110,6 @@ int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_get 5 | } 6 | else if (plot_type == ImGuiPlotType_Histogram) 7 | { 8 | - if (pos1.x >= pos0.x + 2.0f) 9 | - pos1.x -= 1.0f; 10 | window->DrawList->AddRectFilled(pos0, pos1, idx_hovered == v1_idx ? col_hovered : col_base); 11 | } 12 | 13 | diff --git a/imgui.cpp b/imgui.cpp 14 | --- a/imgui.cpp 15 | +++ b/imgui.cpp 16 | @@ -4490,14 +4490,15 @@ void ImGui::StartMouseMovingWindowOrNode(ImGuiWindow* window, ImGuiDockNode* nod 17 | { 18 | ImGuiContext& g = *GImGui; 19 | bool can_undock_node = false; 20 | - if (undock && node != NULL && node->VisibleWindow && (node->VisibleWindow->Flags & ImGuiWindowFlags_NoMove) == 0 && (node->MergedFlags & ImGuiDockNodeFlags_NoUndocking) == 0) 21 | + if (node != NULL && node->VisibleWindow && (node->VisibleWindow->Flags & ImGuiWindowFlags_NoMove) == 0 && (node->MergedFlags & ImGuiDockNodeFlags_NoUndocking) == 0) 22 | { 23 | // Can undock if: 24 | // - part of a hierarchy with more than one visible node (if only one is visible, we'll just move the root window) 25 | // - part of a dockspace node hierarchy: so we can undock the last single visible node too (trivia: undocking from a fixed/central node will create a new node and copy windows) 26 | ImGuiDockNode* root_node = DockNodeGetRootNode(node); 27 | if (root_node->OnlyNodeWithWindows != node || root_node->CentralNode != NULL) // -V1051 PVS-Studio thinks node should be root_node and is wrong about that. 28 | - can_undock_node = true; 29 | + if (undock || root_node->IsDockSpace()) 30 | + can_undock_node = true; 31 | } 32 | 33 | const bool clicked = IsMouseClicked(0); 34 | @@ -13233,6 +13234,8 @@ static ImGuiWindow* FindWindowNavFocusable(int i_start, int i_stop, int dir) // 35 | 36 | static void NavUpdateWindowingHighlightWindow(int focus_change_dir) 37 | { 38 | + focus_change_dir *= -1; 39 | + 40 | ImGuiContext& g = *GImGui; 41 | IM_ASSERT(g.NavWindowingTarget); 42 | if (g.NavWindowingTarget->Flags & ImGuiWindowFlags_Modal) 43 | @@ -13484,7 +13487,7 @@ void ImGui::NavUpdateWindowingOverlay() 44 | SetNextWindowPos(viewport->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f)); 45 | PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.WindowPadding * 2.0f); 46 | Begin("###NavWindowingList", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings); 47 | - for (int n = g.WindowsFocusOrder.Size - 1; n >= 0; n--) 48 | + for (int n = 0; n < g.WindowsFocusOrder.Size; n++) 49 | { 50 | ImGuiWindow* window = g.WindowsFocusOrder[n]; 51 | IM_ASSERT(window != NULL); // Fix static analyzers 52 | -------------------------------------------------------------------------------- /deps/ImGui.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\imgui;%(AdditionalIncludeDirectories) 7 | ImTextureID=ImU64;IMGUI_USER_CONFIG="..\imgui_config.hpp";IMGUI_DEFINE_MATH_OPERATORS;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;IMGUI_DISABLE_FILE_FUNCTIONS;IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS;%(PreprocessorDefinitions) 8 | 9 | 10 | -------------------------------------------------------------------------------- /deps/MinHook.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\minhook\include;%(AdditionalIncludeDirectories) 7 | 8 | 9 | -------------------------------------------------------------------------------- /deps/MinHook.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4f094667-e67f-4105-b94d-5ffd7bc80831} 6 | 7 | 8 | {6d8d397a-3296-469c-bfc1-0138956f951d} 9 | 10 | 11 | 12 | 13 | HDE 14 | 15 | 16 | HDE 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | HDE 25 | 26 | 27 | HDE 28 | 29 | 30 | HDE 31 | 32 | 33 | HDE 34 | 35 | 36 | HDE 37 | 38 | 39 | API 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /deps/OpenVR.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\openvr\headers;$(SolutionDir)deps\openvr\src;%(AdditionalIncludeDirectories) 7 | OPENVR_BUILD_STATIC;%(PreprocessorDefinitions) 8 | 9 | 10 | -------------------------------------------------------------------------------- /deps/OpenXR.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\openxr\include;$(SolutionDir)deps\openxr\src;%(AdditionalIncludeDirectories) 7 | XR_USE_PLATFORM_WIN32;%(PreprocessorDefinitions) 8 | 9 | 10 | -------------------------------------------------------------------------------- /deps/SPIRV.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\spirv\include\spirv\unified1;%(AdditionalIncludeDirectories) 7 | 8 | 9 | -------------------------------------------------------------------------------- /deps/Vulkan.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | $(VK_SDK_PATH)\Bin;$(ExecutablePath) 6 | 7 | 8 | 9 | $(SolutionDir)deps\vulkan\include;$(SolutionDir)deps\vulkan_layer;$(SolutionDir)deps\vma\include;%(AdditionalIncludeDirectories) 10 | VK_USE_PLATFORM_WIN32_KHR;VMA_STATIC_VULKAN_FUNCTIONS=0;VMA_DYNAMIC_VULKAN_FUNCTIONS=0;VMA_STATS_STRING_ENABLED=0;%(PreprocessorDefinitions) 11 | 12 | 13 | -------------------------------------------------------------------------------- /deps/Windows.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\d3d12\include\directx;$(SolutionDir)deps\d3d911on12\include;%(AdditionalIncludeDirectories) 7 | WIN32_LEAN_AND_MEAN;NOGDICAPMASKS;NOMENUS;NOICONS;NOKEYSTATES;NOSYSCOMMANDS;NORASTEROPS;NOATOM;NOCOLOR;NODRAWTEXT;NOMEMMGR;NOMETAFILE;NOMINMAX;NOOPENFILE;NOSCROLL;NOSERVICE;NOSOUND;NOTEXTMETRIC;NOCOMM;NOKANJI;NOHELP;NOPROFILER;NODEFERWINDOWPOS;NOMCX;%(PreprocessorDefinitions) 8 | 9 | 10 | Dwmapi.lib;dxguid.lib;ShLwApi.lib;WinInet.lib;WS2_32.lib;Version.lib;winmm.lib;%(AdditionalDependencies) 11 | 12 | 13 | -------------------------------------------------------------------------------- /deps/d3d12on7/LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crosire/reshade/5ebeb52d965015cc492d6b892945d683ac3f45e2/deps/d3d12on7/LICENSE.txt -------------------------------------------------------------------------------- /deps/d3d911on12/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation. 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /deps/fpng.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\fpng\src;%(AdditionalIncludeDirectories) 7 | FPNG_NO_STDIO;%(PreprocessorDefinitions) 8 | 9 | 10 | -------------------------------------------------------------------------------- /deps/gl3w.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\gl3w\include;%(AdditionalIncludeDirectories) 7 | 8 | 9 | -------------------------------------------------------------------------------- /deps/imgui_config.cpp: -------------------------------------------------------------------------------- 1 | #include "imgui_config.hpp" 2 | 3 | thread_local ImGuiContext *GImGuiThreadLocal = nullptr; 4 | -------------------------------------------------------------------------------- /deps/imgui_config.hpp: -------------------------------------------------------------------------------- 1 | struct ImGuiContext; 2 | extern thread_local ImGuiContext *GImGuiThreadLocal; 3 | 4 | #define GImGui GImGuiThreadLocal 5 | -------------------------------------------------------------------------------- /deps/openvr/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Valve Corporation 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /deps/openvr/src/ivrclientcore.h: -------------------------------------------------------------------------------- 1 | //========= Copyright Valve Corporation ============// 2 | #pragma once 3 | 4 | namespace vr 5 | { 6 | 7 | class IVRClientCore 8 | { 9 | public: 10 | /** Initializes the system */ 11 | virtual EVRInitError Init( vr::EVRApplicationType eApplicationType, const char *pStartupInfo ) = 0; 12 | 13 | /** cleans up everything in vrclient.dll and prepares the DLL to be unloaded */ 14 | virtual void Cleanup() = 0; 15 | 16 | /** checks to see if the specified interface/version is supported in this vrclient.dll */ 17 | virtual EVRInitError IsInterfaceVersionValid( const char *pchInterfaceVersion ) = 0; 18 | 19 | /** Retrieves any interface from vrclient.dll */ 20 | virtual void *GetGenericInterface( const char *pchNameAndVersion, EVRInitError *peError ) = 0; 21 | 22 | /** Returns true if any driver has an HMD attached. Can be called outside of Init/Cleanup */ 23 | virtual bool BIsHmdPresent() = 0; 24 | 25 | /** Returns an English error string from inside vrclient.dll which might be newer than the API DLL */ 26 | virtual const char *GetEnglishStringForHmdError( vr::EVRInitError eError ) = 0; 27 | 28 | /** Returns an error symbol from inside vrclient.dll which might be newer than the API DLL */ 29 | virtual const char *GetIDForVRInitError( vr::EVRInitError eError ) = 0; 30 | }; 31 | 32 | static const char * const IVRClientCore_Version = "IVRClientCore_003"; 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /deps/sk_hdr_png.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\sk_hdr_png\include;%(AdditionalIncludeDirectories) 7 | SK_HDR_PNG_RESHADE;%(PreprocessorDefinitions) 8 | 9 | 10 | -------------------------------------------------------------------------------- /deps/stb.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\stb;$(SolutionDir)deps\stb_image_dds;%(AdditionalIncludeDirectories) 7 | STBI_NO_STDIO;STBI_WRITE_NO_STDIO;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 8 | 9 | 10 | -------------------------------------------------------------------------------- /deps/stb_impl.c: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_IMPLEMENTATION 2 | #define STB_IMAGE_DDS_IMPLEMENTATION 3 | #define STB_IMAGE_WRITE_IMPLEMENTATION 4 | #define STB_IMAGE_RESIZE_IMPLEMENTATION 5 | 6 | #include "stb_image.h" 7 | #include "stb_image_dds.h" 8 | #include "stb_image_write.h" 9 | #include "stb_image_resize2.h" 10 | -------------------------------------------------------------------------------- /deps/utfcpp.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(SolutionDir)deps\utfcpp\source;%(AdditionalIncludeDirectories) 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/01-fps_limit/fps_limit_addon.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Patrick Mours 3 | * SPDX-License-Identifier: BSD-3-Clause OR MIT 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | static int s_fps_limit = 0; 12 | static std::chrono::high_resolution_clock::time_point s_last_time_point; 13 | 14 | static void on_present(reshade::api::command_queue *, reshade::api::swapchain *, const reshade::api::rect *, const reshade::api::rect *, uint32_t, const reshade::api::rect *) 15 | { 16 | if (s_fps_limit <= 0) 17 | return; 18 | 19 | const auto time_per_frame = std::chrono::high_resolution_clock::duration(std::chrono::seconds(1)) / s_fps_limit; 20 | const auto next_time_point = s_last_time_point + time_per_frame; 21 | 22 | while (next_time_point > std::chrono::high_resolution_clock::now()) 23 | std::this_thread::sleep_for(std::chrono::high_resolution_clock::duration(std::chrono::milliseconds(1))); 24 | 25 | s_last_time_point = next_time_point; 26 | } 27 | 28 | static void draw_settings(reshade::api::effect_runtime *) 29 | { 30 | if (ImGui::DragInt("Target FPS", &s_fps_limit, 1, 0, 200)) 31 | s_last_time_point = std::chrono::high_resolution_clock::now(); 32 | 33 | ImGui::SetItemTooltip("Set to zero to disable the FPS limit."); 34 | } 35 | 36 | extern "C" __declspec(dllexport) const char *NAME = "FPS Limiter"; 37 | extern "C" __declspec(dllexport) const char *DESCRIPTION = "Example add-on that limits the frame rate of an application to a specified FPS value."; 38 | 39 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID) 40 | { 41 | switch (fdwReason) 42 | { 43 | case DLL_PROCESS_ATTACH: 44 | if (!reshade::register_addon(hModule)) 45 | return FALSE; 46 | reshade::register_event(on_present); 47 | reshade::register_overlay(nullptr, draw_settings); 48 | break; 49 | case DLL_PROCESS_DETACH: 50 | reshade::unregister_addon(hModule); 51 | break; 52 | } 53 | 54 | return TRUE; 55 | } 56 | -------------------------------------------------------------------------------- /examples/11-obs_capture/obs_hook_info.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Hugh Bailey 3 | * Copyright (C) 2022 Patrick Mours 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | * 6 | * Adapted from https://github.com/obsproject/obs-studio/blob/master/plugins/win-capture/graphics-hook/graphics-hook.h 7 | */ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #define HOOK_VER_MAJOR 1 14 | #define HOOK_VER_MINOR 7 15 | #define HOOK_VER_PATCH 1 16 | 17 | #define NUM_BUFFERS 3 18 | 19 | #define EVENT_CAPTURE_RESTART L"CaptureHook_Restart" 20 | #define EVENT_CAPTURE_STOP L"CaptureHook_Stop" 21 | 22 | #define EVENT_HOOK_READY L"CaptureHook_HookReady" 23 | #define EVENT_HOOK_EXIT L"CaptureHook_Exit" 24 | 25 | #define EVENT_HOOK_INIT L"CaptureHook_Initialize" 26 | 27 | #define WINDOW_HOOK_KEEPALIVE L"CaptureHook_KeepAlive" 28 | 29 | #define MUTEX_TEXTURE1 L"CaptureHook_TextureMutex1" 30 | #define MUTEX_TEXTURE2 L"CaptureHook_TextureMutex2" 31 | 32 | #define SHMEM_HOOK_INFO L"CaptureHook_HookInfo" 33 | #define SHMEM_TEXTURE L"CaptureHook_Texture" 34 | 35 | enum capture_type 36 | { 37 | CAPTURE_TYPE_MEMORY, 38 | CAPTURE_TYPE_TEXTURE, 39 | }; 40 | 41 | #pragma pack(push, 8) 42 | 43 | struct hook_info 44 | { 45 | /* hook version */ 46 | uint32_t hook_ver_major; 47 | uint32_t hook_ver_minor; 48 | 49 | /* capture info */ 50 | capture_type type; 51 | uint32_t window; 52 | uint32_t format; 53 | uint32_t cx; 54 | uint32_t cy; 55 | uint32_t UNUSED_base_cx; 56 | uint32_t UNUSED_base_cy; 57 | uint32_t pitch; 58 | uint32_t map_id; 59 | uint32_t map_size; 60 | bool flip; 61 | 62 | /* additional options */ 63 | uint64_t frame_interval; 64 | bool UNUSED_use_scale; 65 | bool force_shmem; 66 | bool capture_overlay; 67 | bool allow_srgb_alias; 68 | 69 | uint8_t reserved[574]; 70 | }; 71 | static_assert(sizeof(hook_info) == 648); 72 | 73 | struct shmem_data 74 | { 75 | volatile int last_tex; 76 | uint32_t tex1_offset; 77 | uint32_t tex2_offset; 78 | }; 79 | 80 | struct shtex_data 81 | { 82 | uint32_t tex_handle; 83 | }; 84 | 85 | #pragma pack(pop) 86 | 87 | extern hook_info *global_hook_info; 88 | 89 | extern void shmem_copy_data(size_t idx, void *volatile data); 90 | extern bool shmem_texture_data_lock(int idx); 91 | extern void shmem_texture_data_unlock(int idx); 92 | 93 | bool hook_init(); 94 | void hook_free(); 95 | 96 | bool capture_init_shtex(shtex_data *&data, void *window, uint32_t cx, uint32_t cy, uint32_t format, bool flip, uintptr_t handle); 97 | bool capture_init_shmem(shmem_data *&data, void *window, uint32_t cx, uint32_t cy, uint32_t pitch, uint32_t format, bool flip); 98 | void capture_free(); 99 | 100 | bool capture_ready(); 101 | bool capture_alive(); 102 | bool capture_active(); 103 | bool capture_stopped(); 104 | bool capture_restarted(); 105 | 106 | bool capture_signal_ready(); 107 | bool capture_signal_restart(); 108 | 109 | inline bool capture_should_stop() 110 | { 111 | return capture_active() && capture_stopped() && !capture_alive(); 112 | } 113 | inline bool capture_should_init() 114 | { 115 | return !capture_active() && capture_restarted() && capture_alive(); 116 | } 117 | -------------------------------------------------------------------------------- /examples/14-ray_tracing/ray_tracing.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/14-ray_tracing/ray_tracing_shaders.hlsl: -------------------------------------------------------------------------------- 1 | [[vk::binding(0)]] 2 | RaytracingAccelerationStructure as : register(t0); 3 | [[vk::binding(1)]] 4 | RWTexture2D image : register(u0); 5 | 6 | struct Payload 7 | { 8 | float3 color; 9 | }; 10 | 11 | [shader("raygeneration")] 12 | void main_raygen() 13 | { 14 | const float2 uv = (float2(DispatchRaysIndex().xy) + float2(0.5, 0.5)) / float2(DispatchRaysDimensions().xy); 15 | 16 | float3 origin = float3(0.0, 0.0, 0.0); 17 | float3 direction = normalize(float3(uv * 2.0 - 1.0, 1.0)); 18 | 19 | RayDesc ray = { origin, 0.1, direction, 1000.0 }; 20 | Payload payload = { float3(0.0, 0.0, 0.0) }; 21 | 22 | TraceRay(as, 0, 0xFF, 0, 0, 0, ray, payload); 23 | 24 | image[DispatchRaysIndex().xy] = float4(payload.color, 0.0); 25 | } 26 | 27 | [shader("miss")] 28 | void main_miss(inout Payload payload) 29 | { 30 | payload.color = float3(0.0, 0.0, 0.0); 31 | } 32 | 33 | [shader("closesthit")] 34 | void main_closest_hit(inout Payload payload, in BuiltInTriangleIntersectionAttributes attribs) 35 | { 36 | const float3 barycentrics = float3(1.0 - attribs.barycentrics.x - attribs.barycentrics.y, attribs.barycentrics.x, attribs.barycentrics.y); 37 | payload.color = barycentrics; 38 | } 39 | -------------------------------------------------------------------------------- /examples/17-screenshot_to_clipboard/screenshot_to_clipboard_addon.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Patrick Mours 3 | * SPDX-License-Identifier: BSD-3-Clause OR MIT 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | static void on_screenshot(reshade::api::effect_runtime *, const char *path_string) 12 | { 13 | if (!OpenClipboard(nullptr)) 14 | return; 15 | 16 | const std::wstring path = std::filesystem::u8path(path_string).wstring(); 17 | 18 | const HDROP drop_handle = static_cast(GlobalAlloc(GHND, sizeof(DROPFILES) + (path.size() + 1 + 1) * sizeof(WCHAR))); // Terminated with two zero characters 19 | if (drop_handle != nullptr) 20 | { 21 | const LPDROPFILES drop_data = static_cast(GlobalLock(drop_handle)); 22 | if (drop_data != nullptr) 23 | { 24 | drop_data->pFiles = sizeof(DROPFILES); 25 | drop_data->fWide = TRUE; 26 | 27 | std::memcpy(reinterpret_cast(drop_data) + drop_data->pFiles, path.c_str(), path.size() * sizeof(WCHAR)); 28 | 29 | GlobalUnlock(drop_handle); 30 | 31 | EmptyClipboard(); 32 | if (SetClipboardData(CF_HDROP, drop_handle) == nullptr) 33 | GlobalFree(drop_handle); 34 | } 35 | else 36 | { 37 | GlobalFree(drop_handle); 38 | } 39 | } 40 | 41 | CloseClipboard(); 42 | } 43 | 44 | extern "C" __declspec(dllexport) const char *NAME = "Copy screenshot to clipboard"; 45 | 46 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID) 47 | { 48 | switch (fdwReason) 49 | { 50 | case DLL_PROCESS_ATTACH: 51 | if (!reshade::register_addon(hModule)) 52 | return FALSE; 53 | reshade::register_event(on_screenshot); 54 | break; 55 | case DLL_PROCESS_DETACH: 56 | reshade::unregister_addon(hModule); 57 | break; 58 | } 59 | 60 | return TRUE; 61 | } 62 | -------------------------------------------------------------------------------- /examples/utils/config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Patrick Mours 3 | * SPDX-License-Identifier: BSD-3-Clause OR MIT 4 | */ 5 | 6 | // The subdirectory to save shader binaries to 7 | #define RESHADE_ADDON_SHADER_SAVE_DIR ".\\shaderdump" 8 | 9 | // The subdirectory to load shader binaries from 10 | #define RESHADE_ADDON_SHADER_LOAD_DIR ".\\shaderreplace" 11 | 12 | // The subdirectory to save textures to 13 | #define RESHADE_ADDON_TEXTURE_SAVE_DIR ".\\texdump" 14 | #define RESHADE_ADDON_TEXTURE_SAVE_FORMAT ".png" 15 | #define RESHADE_ADDON_TEXTURE_SAVE_HASH_TEXMOD 1 16 | // Skip any textures that were already dumped this session, to reduce lag at the cost of increased memory usage 17 | #define RESHADE_ADDON_TEXTURE_SAVE_ENABLE_HASH_SET 1 18 | 19 | // The subdirectory to load textures from 20 | #define RESHADE_ADDON_TEXTURE_LOAD_DIR ".\\texreplace" 21 | #define RESHADE_ADDON_TEXTURE_LOAD_FORMAT ".png" 22 | #define RESHADE_ADDON_TEXTURE_LOAD_HASH_TEXMOD 1 23 | -------------------------------------------------------------------------------- /examples/utils/state_tracking.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Patrick Mours 3 | * SPDX-License-Identifier: BSD-3-Clause OR MIT 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | /// 12 | /// A state block capturing current state of a command list. 13 | /// 14 | struct state_block 15 | { 16 | /// 17 | /// Binds all state captured by this state block on the specified command list. 18 | /// 19 | /// Target command list to bind the state on. 20 | void apply(reshade::api::command_list *cmd_list) const; 21 | 22 | /// 23 | /// Removes all state in this state block. 24 | /// 25 | void clear(); 26 | 27 | std::vector render_targets; 28 | reshade::api::resource_view depth_stencil = { 0 }; 29 | std::unordered_map pipelines; 30 | reshade::api::primitive_topology primitive_topology = reshade::api::primitive_topology::undefined; 31 | uint32_t blend_constant = 0; 32 | uint32_t sample_mask = 0xFFFFFFFF; 33 | uint32_t front_stencil_reference_value = 0; 34 | uint32_t back_stencil_reference_value = 0; 35 | std::vector viewports; 36 | std::vector scissor_rects; 37 | std::unordered_map>> descriptor_tables; 38 | }; 39 | 40 | /// 41 | /// An instance of this is automatically created for all command lists and can be queried with cmd_list->get_private_data<state_tracking>() (assuming state tracking was registered via ). 42 | /// 43 | class __declspec(uuid("c9abddf0-f9c2-4a7b-af49-89d8d470e207")) state_tracking : public state_block 44 | { 45 | public: 46 | /// 47 | /// Registers all the necessary add-on events for state tracking to work. 48 | /// 49 | static void register_events(); 50 | /// 51 | /// Unregisters all the necessary add-on events for state tracking to work. 52 | /// 53 | static void unregister_events(); 54 | }; 55 | -------------------------------------------------------------------------------- /res/fonts/forkawesome.h: -------------------------------------------------------------------------------- 1 | //Header Generated with https://github.com/aiekick/ImGuiFontStudio 2 | //Based on https://github.com/juliettef/IconFontCppHeaders 3 | 4 | #pragma once 5 | 6 | #define FONT_ICON_BUFFER_NAME_FK FK_compressed_data_base85 7 | #define FONT_ICON_BUFFER_SIZE_FK 0xc26 8 | 9 | #define ICON_MIN_FK 0xf002 10 | #define ICON_MAX_FK 0xf1c9 11 | 12 | #define ICON_FK_CANCEL u8"\uf00d" 13 | #define ICON_FK_FILE u8"\uf016" 14 | #define ICON_FK_FILE_CODE u8"\uf1c9" 15 | #define ICON_FK_FILE_IMAGE u8"\uf1c5" 16 | #define ICON_FK_FLOPPY u8"\uf0c7" 17 | #define ICON_FK_FOLDER u8"\uf114" 18 | #define ICON_FK_FOLDER_OPEN u8"\uf115" 19 | #define ICON_FK_MINUS u8"\uf068" 20 | #define ICON_FK_OK u8"\uf00c" 21 | #define ICON_FK_PENCIL u8"\uf040" 22 | #define ICON_FK_PLUS u8"\uf067" 23 | #define ICON_FK_REFRESH u8"\uf021" 24 | #define ICON_FK_SEARCH u8"\uf002" 25 | #define ICON_FK_UNDO u8"\uf0e2" 26 | #define ICON_FK_WARNING u8"\uf071" 27 | -------------------------------------------------------------------------------- /res/fonts/forkawesome.ifs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | FK 22 | forkawesome-webfont.ttf 23 | 1 24 | 32 25 | 26 | 27 | 20 28 | 29 | true 30 | true 31 | true 32 | 1 33 | false 34 | 5 35 | 653 36 | forkawesome-webfont.ttf 37 | 38 | 39 | -------------------------------------------------------------------------------- /res/fonts/forkawesome.inl: -------------------------------------------------------------------------------- 1 | #include "forkawesome.h" 2 | 3 | static const char FONT_ICON_BUFFER_NAME_FK[3110+1] = 4 | "7])#######l4F<6'/###[),##+Sl##Q6>##w#S+HcY..Xm1NP&&A'o/dJ[^Ii4j)%afG<-dwhP/-2JuBXhc/(,xkA##B^01:_[FH<:p3#L,>>#:qEn/Bd@UCAuOi$hhG<-87T;-QF%U." 5 | "4tw<6rhG<-]vhP/Q-0%JU)*Im0YK_#:7KwA--4S>-Mr*J-2%KgL`Kss'k,e'&(_.R3dFrZu2/FI%[CP)M*f(HMP;7A-A_@U.Blu##[brX-rLmHHsn&W74xD_&4oP]O" 6 | ":*L/L7q+N'w[a`WCT8U)$bj-$D)+Z$CFt-$N;>uu`0YR*OWe;%s9]jL3MG8.'5>##SFpG##WPj&#%r0hLgVV8&jIdK'<;/q-X,-9dS=N'*ABppd#),##i@H0'L0:/DNAhJ)" 7 | "Fs.O=/MbA#99uD+rSXL#=1GcMgJG&#i8Lw-Sr[fLrrH##.GY##2Sl##6`($#ePgc.>xL$#1ZqV%p[%/1,60MTqWLA+%O5SeGDfY,os.Gik/f`E-PQ/1?kR/9hu>#fl?Q#(./J36qiYLMOP?uuYg8e$UNc##K(m<-?qD#MbPMG)@f)T/^b%T%S2`^#J:8Y.pV*i(" 9 | "T=)?#h-[guT#9iu&](?#A]wG;[Dm]uB*07QK(]qFV=fV$H[`V$#kUK#$8^fLmw@8%P92^uJ98=/+@u2OHI.o`5BOojOps+/QlRfL*xFt$=bx5#G%KgLmb]s$wkH>#iE(E#VA@r%Mep$-" 10 | "T1G$,G2J1,mQOhuvne.Mv?75/Huiw'6`?$=VC]&,EH*7M:9s%,:7QVQNcb-?GlguuWN3L#Y@%%#+.>15XAic)rkh8.mNv)4')'J3Ne_F*-vY8/NmVE-*tbU%.qFX$]f.'5/^@+0j.8$$H33-,+VxA&W@1,'#(kZoAKkP9MTC(T7" 12 | "t#;(,b_mL,v?qr&4uG##%J/GV;leJj:SU*%S6[0#9%T*#?3B:%isAv-&O]s$^jtJ)iMTG.KG>c4[lZ#6*@G.)Kfhd3WH5<.*M4gL;ngo0TAOZ6W.PV-RVx_4QmuX$KOj`ub>(6RTcZUL" 13 | "bR39/oBfU+-p9x9SP>bnQ5&X%pbO-)&-g[us_.u-=^7>N8$EG'i_7MTv+qM#ReBtLg@RxktpqbrUv?rC*+8C8i&X1)e61nLx-$O*%@h-Ml=DX-xv@=(`()?#B8WeFeN4kL4Sq'#'&>uu" 14 | "D@]p$?HY##Pe[%#jMOV-H,Jd)K?_`3qh)?#0SEF3oc@A4voXV-HNpdmrZ*G4S)ZA#V8HC@BO?h#l7=9%8>>#XIVS%Ae8e$rLb&#MYWI))CuM(jAqB#]p*P(uAOZ6m('J3k#fF4Rq@.*G7K,3L1O058b4-5mS4'5841'5%J/GV/1:B#'at%$q^DIMiYV6MdS6##,>3/L" 16 | "dbb(NRdimM-a4o7qPa>$cMDX:c)L'5&8YuuCmxE%jxIfLNdP&#&sgo.5>PjLcgp>,&'ihLoGb%$kLu/MdB]s$8uaX(g?T:%-<3jLV*<9/r4)mL`ZH##gFYF'rh%T%kE,7&#-xh&`]3I)" 17 | "bRX-)Vi08.bC/#.&_H#6*,`#$b9bS9#Yhb'0R:-MA<6GMXfU9%NB5N'q(73'4(NSt?fxD,os3;7]OQ--#E^>e&@,gL7R=g*P(Bis9))%x[-" 18 | ",CS@#_t1kbE'7eM=WqP8[`_s-D7H>#Ot]=u'bKd33_+/(R4U8.b(<9/%&AA4LU%],sq-x64=S_#vBo8%FLHm8=N#B=[5ZA#83E.3C4Z##PIpUm6MU7eK2[S%+.`0(k3VNI%(Y4=%]uY`n9.0O7DEhTr2a52Ca79XIMbevebt2o7^Bf,jl2r" 23 | "(2M'#J.#I9mU7C#mc4c4br9s-;va.3DY[OVk1k3Gpv,W.O-F%beUU@-$eQX.4^(##2tff.P=#+#g_B1#?LFdo>kEBbT%JpO]:Co4;hFwf1eG0Y5W-lKx?0aeKh5" 26 | "WTw0FZd^$&p)fUC2ve:C3n8AtjXI)g"; 27 | 28 | -------------------------------------------------------------------------------- /res/main_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crosire/reshade/5ebeb52d965015cc492d6b892945d683ac3f45e2/res/main_icon.ico -------------------------------------------------------------------------------- /res/main_icon_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crosire/reshade/5ebeb52d965015cc492d6b892945d683ac3f45e2/res/main_icon_small.png -------------------------------------------------------------------------------- /res/main_icon_small.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 18 | 21 | 24 | 28 | 29 | 30 | 33 | 36 | 38 | 42 | 46 | 50 | 51 | 53 | 57 | 61 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /res/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by resource.rc 4 | // 5 | #define IDR_COPY_PS 101 6 | #define IDR_FULLSCREEN_VS 102 7 | #define IDR_IMGUI_PS_3_0 103 8 | #define IDR_IMGUI_PS_4_0 104 9 | #define IDR_IMGUI_PS_GLSL 105 10 | #define IDR_IMGUI_PS_SPIRV 106 11 | #define IDR_IMGUI_VS_3_0 107 12 | #define IDR_IMGUI_VS_4_0 108 13 | #define IDR_IMGUI_VS_GLSL 109 14 | #define IDR_IMGUI_VS_SPIRV 110 15 | #define IDR_MIPMAP_CS 111 16 | #define IDR_MIPMAP_CS_GLSL 112 17 | #define IDB_MAIN_ICON 600 18 | #define IDR_LICENSE_GL3W 701 19 | #define IDR_LICENSE_IMGUI 702 20 | #define IDR_LICENSE_MINHOOK 703 21 | #define IDR_LICENSE_OPENVR 704 22 | #define IDR_LICENSE_OPENXR 705 23 | #define IDR_LICENSE_RESHADE 706 24 | #define IDR_LICENSE_SPIRV 707 25 | #define IDR_LICENSE_STB 708 26 | #define IDR_LICENSE_UTFCPP 709 27 | #define IDR_LICENSE_VMA 710 28 | #define IDR_LICENSE_VULKAN 711 29 | 30 | // Next default values for new objects 31 | // 32 | #ifdef APSTUDIO_INVOKED 33 | #ifndef APSTUDIO_READONLY_SYMBOLS 34 | #define _APS_NEXT_RESOURCE_VALUE 115 35 | #define _APS_NEXT_COMMAND_VALUE 40001 36 | #define _APS_NEXT_CONTROL_VALUE 1001 37 | #define _APS_NEXT_SYMED_VALUE 115 38 | #endif 39 | #endif 40 | -------------------------------------------------------------------------------- /res/shaders/copy_ps.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | void main(float4 vpos : SV_POSITION, float2 uv : TEXCOORD0, out float4 col : SV_TARGET) 5 | { 6 | col = t0.Sample(s0, uv); 7 | col.a = 1.0; // Clear alpha channel 8 | } 9 | -------------------------------------------------------------------------------- /res/shaders/fullscreen_vs.hlsl: -------------------------------------------------------------------------------- 1 | // Vertex shader generating a triangle covering the entire screen 2 | void main(uint id : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 uv : TEXCOORD0) 3 | { 4 | uv.x = (id == 1) ? 2.0 : 0.0; 5 | uv.y = (id == 2) ? 2.0 : 0.0; 6 | pos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /res/shaders/imgui_hdr.hlsl: -------------------------------------------------------------------------------- 1 | #ifdef float3x3 2 | #define mul(a, b) (a) * (b) 3 | #endif 4 | 5 | #define COLOR_SPACE_SRGB 1 6 | #define COLOR_SPACE_HDR10 3 7 | #define COLOR_SPACE_HLG 4 8 | #define COLOR_SPACE_SCRGB 2 9 | 10 | float3 bt709_to_bt2020(float3 col) 11 | { 12 | const float3x3 bt709_to_bt2020 = float3x3( 13 | 0.627403914928436279296875, 0.3292830288410186767578125, 0.0433130674064159393310546875, 14 | 0.069097287952899932861328125, 0.9195404052734375, 0.011362315155565738677978515625, 15 | 0.01639143936336040496826171875, 0.08801330626010894775390625, 0.895595252513885498046875); 16 | 17 | return mul(bt709_to_bt2020, col); 18 | } 19 | 20 | float3 pq_inverse_eotf(float3 col) // 1.0 = 10000 nits here 21 | { 22 | // PQ constants as per Rec. ITU-R BT.2100-2 Table 4 23 | const float PQ_m1 = 0.1593017578125; 24 | const float PQ_m2 = 78.84375; 25 | const float PQ_c1 = 0.8359375; 26 | const float PQ_c2 = 18.8515625; 27 | const float PQ_c3 = 18.6875; 28 | 29 | float3 col_pow_m1 = pow(col, PQ_m1.xxx); 30 | 31 | return pow((PQ_c1 + PQ_c2 * col_pow_m1) / (1.f + PQ_c3 * col_pow_m1), PQ_m2.xxx); 32 | } 33 | 34 | float hlg_inverse_eotf(float col) // 1.0 = 1000 nits here 35 | { 36 | // HLG constants as per Rec. ITU-R BT.2100-2 Table 5 37 | const float HLG_a = 0.17883277; 38 | const float HLG_b = 0.28466892; // 1 - 4 * HLG_a 39 | const float HLG_c = 0.559910714626312255859375; // 0.5 - HLG_a * ln(4 * HLG_a) 40 | 41 | if (col <= (1.0 / 12.0)) 42 | { 43 | return sqrt(3.0 * col); 44 | } 45 | else 46 | { 47 | return HLG_a * log(12.0 * col - HLG_b) + HLG_c; 48 | } 49 | } 50 | float3 hlg_inverse_eotf(float3 col) 51 | { 52 | return float3(hlg_inverse_eotf(col.r), hlg_inverse_eotf(col.g), hlg_inverse_eotf(col.b)); 53 | } 54 | 55 | // HDR10 (PQ transfer function + BT.2020 primaries) 56 | float3 to_pq(float3 col) 57 | { 58 | col = pow(col, 2.2.xxx); 59 | col = bt709_to_bt2020(col); 60 | col = col * hdr_overlay_brightness / 10000.0; 61 | col = pq_inverse_eotf(col); 62 | 63 | return col; 64 | } 65 | 66 | // HLG (HLG transfer function + BT.2020 primaries) 67 | float3 to_hlg(float3 col) 68 | { 69 | col = pow(col, 2.2.xxx); 70 | col = bt709_to_bt2020(col); 71 | col = col * hdr_overlay_brightness / 1000.0; 72 | col = hlg_inverse_eotf(col); 73 | 74 | return col; 75 | } 76 | 77 | // scRGB (linear + BT.709/sRGB primaries) 78 | float3 to_scrgb(float3 col) // 1.0 = 80 nits in scRGB 79 | { 80 | col = pow(col, 2.2.xxx); 81 | col = col * hdr_overlay_brightness / 80.0; 82 | 83 | return col; 84 | } 85 | -------------------------------------------------------------------------------- /res/shaders/imgui_ps_3_0.hlsl: -------------------------------------------------------------------------------- 1 | sampler2D s0 : register(s0); 2 | 3 | void main(float4 vpos : VPOS, float4 vcol : COLOR0, float2 uv : TEXCOORD0, out float4 col : COLOR) 4 | { 5 | col = tex2D(s0, uv); 6 | col *= vcol; // Blend vertex color and texture 7 | } 8 | -------------------------------------------------------------------------------- /res/shaders/imgui_ps_430.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(binding = 0) uniform sampler2D s0; 4 | 5 | in vec4 frag_col; 6 | in vec2 frag_tex; 7 | 8 | out vec4 col; 9 | 10 | void main() 11 | { 12 | col = texture(s0, frag_tex); 13 | col *= frag_col; // Blend vertex color and texture 14 | } 15 | -------------------------------------------------------------------------------- /res/shaders/imgui_ps_450.glsl: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | #extension GL_ARB_shading_language_include : require 3 | 4 | layout(set = 0, binding = 0) uniform sampler2D s0; 5 | 6 | layout(location = 0) in struct { vec4 col; vec2 tex; } i; 7 | vec4 vcol = i.col; 8 | layout(location = 0) out vec4 col; 9 | 10 | layout(push_constant) uniform PushConstants 11 | { 12 | // Offset from the orthographic projection matrix used in the vertex shader 13 | layout(offset = 64) uint color_space; 14 | layout(offset = 68) float hdr_overlay_brightness; 15 | }; 16 | 17 | #include "imgui_hdr.hlsl" 18 | 19 | void main() 20 | { 21 | if (color_space == COLOR_SPACE_HDR10) 22 | { 23 | vcol.rgb = to_pq(vcol.rgb); 24 | } 25 | else if (color_space == COLOR_SPACE_HLG) 26 | { 27 | vcol.rgb = to_hlg(vcol.rgb); 28 | } 29 | else if (color_space == COLOR_SPACE_SCRGB) 30 | { 31 | vcol.rgb = to_scrgb(vcol.rgb); 32 | } 33 | 34 | col = texture(s0, i.tex); 35 | col *= vcol; // Blend vertex color and texture 36 | } 37 | -------------------------------------------------------------------------------- /res/shaders/imgui_ps_450.spv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crosire/reshade/5ebeb52d965015cc492d6b892945d683ac3f45e2/res/shaders/imgui_ps_450.spv -------------------------------------------------------------------------------- /res/shaders/imgui_ps_450_hdr.spv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crosire/reshade/5ebeb52d965015cc492d6b892945d683ac3f45e2/res/shaders/imgui_ps_450_hdr.spv -------------------------------------------------------------------------------- /res/shaders/imgui_ps_4_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | cbuffer PushConstants : register(b0) 5 | { 6 | // Offset from the orthographic projection matrix used in the vertex shader 7 | uint color_space : packoffset(c4.x); 8 | float hdr_overlay_brightness : packoffset(c4.y); 9 | }; 10 | 11 | #include "imgui_hdr.hlsl" 12 | 13 | void main(float4 vpos : SV_POSITION, float4 vcol : COLOR0, float2 uv : TEXCOORD0, out float4 col : SV_TARGET) 14 | { 15 | if (color_space == COLOR_SPACE_HDR10) 16 | { 17 | vcol.rgb = to_pq(vcol.rgb); 18 | } 19 | else if (color_space == COLOR_SPACE_HLG) 20 | { 21 | vcol.rgb = to_hlg(vcol.rgb); 22 | } 23 | else if (color_space == COLOR_SPACE_SCRGB) 24 | { 25 | vcol.rgb = to_scrgb(vcol.rgb); 26 | } 27 | 28 | col = t0.Sample(s0, uv); 29 | col *= vcol; // Blend vertex color and texture 30 | } 31 | -------------------------------------------------------------------------------- /res/shaders/imgui_vs_3_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_INPUT 2 | { 3 | float2 pos : POSITION; 4 | float4 col : COLOR0; 5 | float2 tex : TEXCOORD0; 6 | }; 7 | struct PS_INPUT 8 | { 9 | float4 pos : POSITION; 10 | float4 col : COLOR0; 11 | float2 tex : TEXCOORD0; 12 | }; 13 | 14 | uniform float4x4 ortho_projection; 15 | 16 | void main(VS_INPUT input, out PS_INPUT output) 17 | { 18 | output.pos = mul(ortho_projection, float4(input.pos.xy, 0.0, 1.0)); 19 | output.col = input.col; 20 | output.tex = input.tex; 21 | } 22 | -------------------------------------------------------------------------------- /res/shaders/imgui_vs_430.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(location = 0) in vec2 pos; 4 | layout(location = 1) in vec2 tex; 5 | layout(location = 2) in vec4 col; 6 | 7 | out vec4 frag_col; 8 | out vec2 frag_tex; 9 | 10 | layout(binding = 0) uniform PushConstants 11 | { 12 | mat4 ortho_projection; 13 | }; 14 | 15 | void main() 16 | { 17 | frag_col = col; 18 | frag_tex = tex; 19 | gl_Position = ortho_projection * vec4(pos.xy, 0, 1); 20 | } 21 | -------------------------------------------------------------------------------- /res/shaders/imgui_vs_450.glsl: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | 3 | layout(location = 0) in vec2 pos; 4 | layout(location = 1) in vec2 tex; 5 | layout(location = 2) in vec4 col; 6 | layout(location = 0) out struct { vec4 col; vec2 tex; } o; 7 | 8 | layout(push_constant) uniform PushConstants 9 | { 10 | mat4 ortho_projection; 11 | }; 12 | 13 | void main() 14 | { 15 | o.col = col; 16 | o.tex = tex; 17 | gl_Position = ortho_projection * vec4(pos, 0, 1); 18 | } 19 | -------------------------------------------------------------------------------- /res/shaders/imgui_vs_450.spv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crosire/reshade/5ebeb52d965015cc492d6b892945d683ac3f45e2/res/shaders/imgui_vs_450.spv -------------------------------------------------------------------------------- /res/shaders/imgui_vs_4_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_INPUT 2 | { 3 | float2 pos : POSITION; 4 | float4 col : COLOR0; 5 | float2 tex : TEXCOORD0; 6 | }; 7 | struct PS_INPUT 8 | { 9 | float4 pos : SV_POSITION; 10 | float4 col : COLOR0; 11 | float2 tex : TEXCOORD0; 12 | }; 13 | 14 | cbuffer PushConstants : register(b0) 15 | { 16 | float4x4 ortho_projection; 17 | }; 18 | 19 | void main(VS_INPUT input, out PS_INPUT output) 20 | { 21 | output.pos = mul(ortho_projection, float4(input.pos.xy, 0.0, 1.0)); 22 | output.col = input.col; 23 | output.tex = input.tex; 24 | } 25 | -------------------------------------------------------------------------------- /res/shaders/mipmap_cs_430.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(binding = 0) uniform sampler2D src; 4 | layout(binding = 1) uniform writeonly image2D dest; 5 | 6 | layout(location = 0) uniform int src_level; 7 | 8 | layout(local_size_x = 8, local_size_y = 8) in; 9 | 10 | vec4 reduce(ivec2 location) 11 | { 12 | vec4 v0 = texelFetch(src, location + ivec2(0, 0), src_level); 13 | vec4 v1 = texelFetch(src, location + ivec2(0, 1), src_level); 14 | vec4 v2 = texelFetch(src, location + ivec2(1, 0), src_level); 15 | vec4 v3 = texelFetch(src, location + ivec2(1, 1), src_level); 16 | return (v0 + v1 + v2 + v3) * 0.25; 17 | } 18 | 19 | void main() 20 | { 21 | vec4 v = reduce(ivec2(gl_GlobalInvocationID.xy * 2)); 22 | imageStore(dest, ivec2(gl_GlobalInvocationID.xy), v); 23 | } 24 | -------------------------------------------------------------------------------- /res/version.rc2: -------------------------------------------------------------------------------- 1 | #include "version.h" 2 | 3 | ///////////////////////////////////////////////////////////////////////////// 4 | // 5 | // Version 6 | // 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION,VERSION_BUILD 10 | PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION,VERSION_BUILD 11 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 12 | #ifdef _DEBUG 13 | FILEFLAGS (VS_FF_PRERELEASE | VS_FF_DEBUG) 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS VOS_NT_WINDOWS32 18 | FILETYPE VFT_DLL 19 | FILESUBTYPE VFT2_UNKNOWN 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040004b0" 24 | BEGIN 25 | VALUE "CompanyName", "crosire" 26 | VALUE "FileVersion", VERSION_STRING_FILE 27 | VALUE "ProductName", "ReShade" 28 | VALUE "ProductVersion", VERSION_STRING_PRODUCT 29 | VALUE "LegalCopyright", "Copyright © 2014. All rights reserved." 30 | #ifdef RESHADE_FXC 31 | VALUE "FileDescription", "ReShade FX compiler" 32 | #else 33 | #ifndef _WIN64 34 | VALUE "FileDescription", "crosire's ReShade post-processing injector for 32-bit" 35 | VALUE "OriginalFilename", "ReShade32.dll" 36 | #else 37 | VALUE "FileDescription", "crosire's ReShade post-processing injector for 64-bit" 38 | VALUE "OriginalFilename", "ReShade64.dll" 39 | #endif 40 | #endif 41 | END 42 | END 43 | BLOCK "VarFileInfo" 44 | BEGIN 45 | VALUE "Translation", 0x400, 0x4b0 46 | END 47 | END 48 | -------------------------------------------------------------------------------- /setup/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 |