diff --git a/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl b/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl index 1f6c93aac7..58c2318c51 100644 --- a/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl +++ b/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl @@ -48,11 +48,12 @@ RWTexture2D MotionVectorOutput : register(u2); float neighborDepth = DepthMask[samplePos]; -#if defined(DLSS) || defined(XESS) // Take neighbor if it's longer AND closer if (neighborDepth < depth){ taaMask.x = min(taaMask.x, TAAMask[samplePos].x); +#if defined(DLSS) || defined(XESS) + float2 neighborMotionVector = MotionVectorMask[samplePos]; // Square motion vector for length diff --git a/src/Deferred.cpp b/src/Deferred.cpp index 5a1aecc18c..03c842529d 100644 --- a/src/Deferred.cpp +++ b/src/Deferred.cpp @@ -409,11 +409,8 @@ void Deferred::DeferredPasses() auto motionVectors = renderer->GetRuntimeData().renderTargets[RE::RENDER_TARGETS::kMOTION_VECTOR]; bool interior = true; - if (auto player = RE::PlayerCharacter::GetSingleton()) { - if (auto parentCell = player->GetParentCell()) { - interior = parentCell->IsInteriorCell(); - } - } + if (auto sky = globals::game::sky) + interior = sky->mode.get() != RE::Sky::Mode::kFull; auto& skylighting = globals::features::skylighting; diff --git a/src/Features/ScreenSpaceGI.cpp b/src/Features/ScreenSpaceGI.cpp index 89d21452e2..8fb7057cdc 100644 --- a/src/Features/ScreenSpaceGI.cpp +++ b/src/Features/ScreenSpaceGI.cpp @@ -113,19 +113,19 @@ void ScreenSpaceGI::DrawSettings() recompileFlag = true; } if (auto _tt = Util::HoverTooltipWrapper()) - ImGui::Text("Quarter res and somewhat stable."); + ImGui::Text("Half res and somewhat stable."); ImGui::TableNextColumn(); - if (ImGui::Button("High", { -1, 0 })) { + if (ImGui::Button("Extreme", { -1, 0 })) { settings.NumSlices = 4; settings.NumSteps = 8; - settings.ResolutionMode = 1; + settings.ResolutionMode = 0; settings.EnableBlur = true; settings.EnableGI = true; recompileFlag = true; } if (auto _tt = Util::HoverTooltipWrapper()) - ImGui::Text("Half res and clean."); + ImGui::Text("Full res and clean."); ImGui::TableNextColumn(); if (ImGui::Button("Reference", { -1, 0 })) { diff --git a/src/Features/Upscaling.cpp b/src/Features/Upscaling.cpp index 17fd038a14..cfb6b2ee91 100644 --- a/src/Features/Upscaling.cpp +++ b/src/Features/Upscaling.cpp @@ -58,9 +58,6 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChainUpscaling( if (!globals::game::isVR) { // Use better swap effect to prevent tearing and improve performance pSwapChainDesc->SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; - - // Set new more precise format - pSwapChainDesc->BufferDesc.Format = DXGI_FORMAT_R10G10B10A2_UNORM; } bool shouldProxy = !globals::game::isVR; @@ -380,49 +377,6 @@ void Upscaling::Load() *(uintptr_t*)&ptrD3D11CreateDeviceAndSwapChainUpscaling = SKSE::PatchIAT(hk_D3D11CreateDeviceAndSwapChainUpscaling, "d3d11.dll", "D3D11CreateDeviceAndSwapChain"); } -struct CreateRenderTarget_LDR1 -{ - static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties) - { - RE::BSGraphics::RenderTargetProperties properties = *a_properties; - properties.format.set(RE::BSGraphics::Format::kR10G10B10A2_UNORM); - func(This, a_target, &properties); - } - static inline REL::Relocation func; -}; - -struct CreateRenderTarget_LDR2 -{ - static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties) - { - RE::BSGraphics::RenderTargetProperties properties = *a_properties; - properties.format.set(RE::BSGraphics::Format::kR10G10B10A2_UNORM); - func(This, a_target, &properties); - } - static inline REL::Relocation func; -}; - -struct CreateRenderTarget_LDR3 -{ - static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties) - { - RE::BSGraphics::RenderTargetProperties properties = *a_properties; - properties.format.set(RE::BSGraphics::Format::kR10G10B10A2_UNORM); - func(This, a_target, &properties); - } - static inline REL::Relocation func; -}; - -struct CreateRenderTarget_LDR4 -{ - static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties) - { - RE::BSGraphics::RenderTargetProperties properties = *a_properties; - properties.format.set(RE::BSGraphics::Format::kR10G10B10A2_UNORM); - func(This, a_target, &properties); - } - static inline REL::Relocation func; -}; void Upscaling::PostPostLoad() { bool isGOG = !GetModuleHandle(L"steam_api64.dll"); @@ -438,12 +392,6 @@ void Upscaling::PostPostLoad() stl::write_thunk_call(REL::RelocationID(100430, 107148).address() + REL::Relocate(0x1F0, 0x1E7, 0x206)); if (!REL::Module::IsVR()) { - // Patches render target creation to use higher precision format - stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x529, 0x528)); - stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0xB2E, 0xB2E)); - stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x62F, 0x62E)); - stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x642, 0x641)); - // Patches RSSetScissorRect calls to use dynamic resolution // This is a PC-specific function hence it was missing stl::detour_thunk(REL::RelocationID(75564, 77365)); @@ -857,7 +805,7 @@ void Upscaling::SetupResources() // Create NIS sharpener texture with swapchain format and UAV access D3D11_TEXTURE2D_DESC nisTexDesc = texDesc; - nisTexDesc.Format = DXGI_FORMAT_R10G10B10A2_UNORM; + nisTexDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; nisTexDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS; D3D11_SHADER_RESOURCE_VIEW_DESC nisSrvDesc = srvDesc; diff --git a/src/Features/Upscaling/DX12SwapChain.cpp b/src/Features/Upscaling/DX12SwapChain.cpp index b816fc145a..608e9df3ce 100644 --- a/src/Features/Upscaling/DX12SwapChain.cpp +++ b/src/Features/Upscaling/DX12SwapChain.cpp @@ -86,7 +86,7 @@ void DX12SwapChain::CreateInterop() swapChainBufferWrapped = new WrappedResource(texDesc11, d3d11Device.get(), upscaling.sharedD3D12Device.get()); - texDesc11.Format = DXGI_FORMAT_R16G16B16A16_UNORM; + texDesc11.Format = DXGI_FORMAT_R8G8B8A8_UNORM; uiBufferWrapped = new WrappedResource(texDesc11, d3d11Device.get(), upscaling.sharedD3D12Device.get()); }