HD: Resolution Scale is monotonic — 100% is DLAA (1:1), not 2/3
The DLSS branch special-cased slider 100% to the 2/3 auto ratio, which made 80% render LARGER than 100% (0.8 > 0.667) — non-monotonic and confusing. The slider is now the render scale directly, capped at 1: 100% renders 1:1 (DLAA), below it DLSS upscales, above it caps at the output. Native TAAU keeps the full 0.5..2.0 range incl. supersampling. Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
@@ -89,9 +89,9 @@ fn env_scale() -> Option<f32> {
|
||||
/// 1. film quality — a capture renders the world at the window's full size;
|
||||
/// 2. `HORIZON_HD_SCALE` — the explicit environment override;
|
||||
/// 3. DLSS evaluating — an upscaler renders no larger than its output, so the slider drives
|
||||
/// the render size capped at 1: at the slider's default (100%) DLSS keeps its own 2/3
|
||||
/// auto ratio, any other value is the render scale, and above 100% the world renders at
|
||||
/// the output size (supersampling is the native TAAU's, with DLSS off);
|
||||
/// the render size capped at 1, monotonically: 100% renders 1:1 (DLAA), below it DLSS
|
||||
/// upscales, and above 100% the world renders at the output size (supersampling is the
|
||||
/// native TAAU's, with DLSS off);
|
||||
/// 4. otherwise the slider itself, including above 1 (supersampling) — `None`.
|
||||
///
|
||||
/// The slider is read every frame, so moving it resizes the world target and DLSS's render
|
||||
@@ -113,11 +113,10 @@ fn scale_for(slider: f32, env: Option<f32>, film: bool, dlss: bool) -> Option<f3
|
||||
return Some(v.clamp(0.25, 1.0));
|
||||
}
|
||||
if dlss {
|
||||
return Some(if slider == 1.0 {
|
||||
2.0 / 3.0
|
||||
} else {
|
||||
slider.clamp(0.25, 1.0)
|
||||
});
|
||||
// The slider is the render scale, monotonic: 100% renders 1:1 (DLAA), below it DLSS
|
||||
// upscales, above it caps at the output (an upscaler renders no larger; supersampling
|
||||
// above 1 is the native TAAU's, with DLSS off).
|
||||
return Some(slider.clamp(0.25, 1.0));
|
||||
}
|
||||
None
|
||||
}
|
||||
@@ -499,9 +498,10 @@ mod tests {
|
||||
|
||||
/// The Resolution Scale slider drives HD's world size: on the native TAAU path it applies
|
||||
/// as-is (including above 1, supersampling); with DLSS evaluating it is the render size
|
||||
/// capped at the output — an upscaler renders no larger — and the slider's default 100%
|
||||
/// keeps DLSS's 2/3 auto ratio. The `HORIZON_HD_SCALE` override and film quality win over
|
||||
/// the slider. This is the bug fix: DLSS used to pin the world at 2/3 whatever the slider.
|
||||
/// capped at the output — an upscaler renders no larger — monotonically, so 100% renders
|
||||
/// 1:1 (DLAA) and 80% renders smaller than 100%. The `HORIZON_HD_SCALE` override and film
|
||||
/// quality win over the slider. This is the bug fix: DLSS used to pin the world at 2/3
|
||||
/// whatever the slider.
|
||||
#[test]
|
||||
fn the_resolution_slider_drives_hd_scale() {
|
||||
// Native TAAU: the slider applies unchanged (`None` = `world_post.scale`).
|
||||
@@ -513,8 +513,9 @@ mod tests {
|
||||
assert_eq!(scale_for(0.8, None, false, true), Some(0.8));
|
||||
assert_eq!(scale_for(1.5, None, false, true), Some(1.0));
|
||||
assert_eq!(scale_for(2.0, None, false, true), Some(1.0));
|
||||
// At the slider's default 100%, DLSS keeps its auto ratio.
|
||||
assert_eq!(scale_for(1.0, None, false, true), Some(2.0 / 3.0));
|
||||
// At 100% DLSS renders 1:1 (DLAA); the scale is monotonic (80% < 100%).
|
||||
assert_eq!(scale_for(1.0, None, false, true), Some(1.0));
|
||||
assert!(scale_for(0.8, None, false, true).unwrap() < scale_for(1.0, None, false, true).unwrap());
|
||||
// The environment override wins over the slider and DLSS's auto.
|
||||
assert_eq!(scale_for(0.5, Some(0.75), false, false), Some(0.75));
|
||||
assert_eq!(scale_for(1.0, Some(0.75), false, true), Some(0.75));
|
||||
|
||||
@@ -241,7 +241,7 @@ mod tests {
|
||||
/// The Resolution Scale slider resizes the world target live: `prepare` at 50 / 100 / 200%
|
||||
/// builds targets of exactly those sizes (HD reads the target even at 100%, `always`), and
|
||||
/// HD's per-frame decision (`hd_scale`, `hd::scale_override`) replaces the slider when set —
|
||||
/// DLSS's auto ratio, the env override, film quality. Without HD, scale 1 and no FXAA still
|
||||
/// the env override, the DLSS render scale, film quality. Without HD, scale 1 and no FXAA still
|
||||
/// draw straight to the screen. Needs a GPU adapter:
|
||||
/// `cargo test -p horizon-client --lib gfx::world_post::tests:: -- --ignored`.
|
||||
#[test]
|
||||
@@ -271,7 +271,7 @@ mod tests {
|
||||
post.scale = 0.8;
|
||||
post.prepare(&device, window, true);
|
||||
assert_eq!(post.size(), Some([1536, 864]));
|
||||
// HD's decision replaces the slider: DLSS's 2/3 auto ratio at the default 100%...
|
||||
// HD's decision replaces the slider: an explicit HD scale (e.g. HORIZON_HD_SCALE=0.67)...
|
||||
post.scale = 1.0;
|
||||
post.hd_scale = Some(2.0 / 3.0);
|
||||
post.prepare(&device, window, true);
|
||||
|
||||
Reference in New Issue
Block a user