Skip to content

Commit

Permalink
Some Fixes
Browse files Browse the repository at this point in the history
- Made scale debug report an integer as it should be in the developer view
- Testing out improved stability on delta by falling back to last scale
  • Loading branch information
KingDavidW committed May 9, 2024
1 parent ca86482 commit 2fd2c6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions build_common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ Write-Host "vswhere found at: $vsWhere" -ForegroundColor Yellow
#
# Get path to Visual Studio installation using vswhere.
#
$vsPath = &$vsWhere -latest -version "[16.0,18.0)" -products * `
-requires Microsoft.Component.MSBuild `
-property installationPath
$vsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
Write-Host "$vsPath" -ForegroundColor Yellow
If ([string]::IsNullOrEmpty("$vsPath")) {
Write-Error "Failed to find Visual Studio 2019 installation. Aborting." -ErrorAction Stop
}
Expand Down
2 changes: 1 addition & 1 deletion src/dxvk/imgui/dxvk_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ namespace dxvk {
if (c->m_type == CameraType::Sky)
{
ImGui::Text("Sky Offset: %.2f %.2f %.2f", c->m_skyOffset.x, c->m_skyOffset.y, c->m_skyOffset.z);
ImGui::Text("Sky Scale: %.2f", c->m_skyScale);
ImGui::Text("Sky Scale: %i", c->m_skyScale);
}
ImGui::Text("Vertical FOV: %.1f", c->getFov() * kRadiansToDegrees);
ImGui::Text("Near / Far plane: %.1f / %.1f", c->getNearPlane(), c->getFarPlane());
Expand Down
7 changes: 3 additions & 4 deletions src/dxvk/rtx_render/rtx_camera_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,15 @@ namespace dxvk {
skyCamera.setSkyScale(RtxOptions::Get()->skyDefaultScale());
break;
case SkyScaleCalibrationMode::DeltaAutomatic:
if ( !areClose(curSkyPos, lastSkyPos) && shouldUpdateMainCamera ) {
if ( !areClose(curSkyPos, lastSkyPos) ) {
float mdiff = lengthSqr(curCamPos - lastCamPos);
float sdiff = lengthSqr(curSkyPos - lastSkyPos);

int new_scale = 1;
if (sdiff != 0) {
float ratio_scale = mdiff / sdiff;
new_scale = ratio_scale > 0 ? static_cast<int>( std::sqrt(ratio_scale) ) : 1;
int new_scale = ratio_scale >= 1 ? static_cast<int>( std::sqrt(ratio_scale) ) : skyCamera.m_lastSkyScale;
skyCamera.setSkyScale(new_scale);
}
skyCamera.setSkyScale(new_scale);
}
break;
case SkyScaleCalibrationMode::SourceEngineAutomatic:
Expand Down

0 comments on commit 2fd2c6a

Please sign in to comment.