Detailed description of the changes.
This commit addresses an issue where Screen Space Ambient Occlusion (SSAO) appearance was inconsistent, particularly in high-resolution snapshots compared to the main viewer window.
Previously, the SSAO radii parameters (RenderSSAOScale and RenderSSAOMaxScale) were directly applied to the shader without considering the resolution difference between the viewer window and the render target (snapshot). This resulted in SSAO appearing too small and under-sampled in high-resolution snapshots, as the sampling radius was not scaled up to match the larger snapshot resolution.
To resolve this, a scaling factor is now calculated based on the ratio of the viewer window's height to the snapshot's height:
scale_factor = viewer_window_height / snapshot_height
This scale factor is then used to divide the user-defined SSAO radius values before they are passed to the shader. When the snapshot resolution is higher than the viewer resolution, the `scale_factor` becomes less than 1. Dividing by this factor effectively increases the SSAO radii, ensuring the ambient occlusion effect scales proportionally to the higher resolution.
For example, if the viewer is running at 1080p height and a snapshot is taken at 4096p height, the scale factor would be approximately 1080 / 4096 ≈ 0.2637. Dividing the SSAO radii by 0.2637 results in multiplying them by approximately 3.79, thus scaling up the SSAO effect to maintain visual consistency in the high-resolution snapshot.
Intended Impact & Benefits:
- **Visual Consistency:** Ensures that the SSAO effect maintains a consistent visual scale and intensity between the interactive viewer display and high-resolution snapshots, providing a more predictable and professional output.
- **Improved User Experience:** Users capturing high-resolution snapshots will now experience a more accurate and visually pleasing SSAO effect, preventing the unintended diminishment of ambient occlusion and preserving the intended scene aesthetics.
- **Balanced Quality Across Resolutions:** The fix dynamically adjusts the SSAO radii based on resolution, maintaining a balanced and consistent level of detail and intensity across varying output resolutions without requiring manual user adjustments.
Testing:
- **Build:** Rebuild the Aperture Viewer after applying this commit.
- **Run:** Launch the viewer and ensure that Screen Space Ambient Occlusion (SSAO) is enabled in the graphics settings.
- **Visual Comparison (Viewer vs. High-Resolution Snapshot):**
1. In the viewer, observe the appearance of SSAO in a scene with noticeable ambient occlusion effects.
2. Take a high-resolution snapshot to disk (e.g., 4096p or higher).
3. Compare the SSAO effect in the saved snapshot image to the SSAO in the live viewer window. The SSAO in the snapshot should now appear visually consistent in scale and intensity with the viewer, and not diminished or under-sampled.
- **Resolution Variation (Recommended):** Test with different viewer window sizes (e.g., 720p, 1080p) and snapshot resolutions (including resolutions higher than the viewer) to verify that the SSAO consistency is maintained across a range of rendering targets.
Documentation:
- No specific updates to the Wiki are required as this commit is a bug fix that improves the existing SSAO feature's consistency.
- It is recommended to include a note about this fix in the Viewer release notes to inform users about the improved SSAO behavior in high-resolution snapshots.
Refined the logic for the textures to include animated textures to not be downscaled They are not forced to be high boost level.
Update the logic of how to process the on screen max vsize to be simpler.
Added split time max_time for the updateImagesCreateTextures, as originally they were two different functions and can save doubled the time for each.
Added time limit on LLViewerObjectList::updateApparentAngles, as it it affects the Textures in the texture list and worked on a fixed # of objects per frame and each object is variable in the amount of processing required, affecting frame rate and # of textures updated.
The manual control for the Limit VRAM texture usage in the Preferences->Graphics->Hardware Settings did not restore the saved value of the slider upload load.
So when the viewer would load, it would indeed load the saved value, but the value was not reflected upon by the slider on the page. This caused issues of when a user went to move the slide back to it's intended position it would set off the bias system as well as make the user not have confidence in that the feature is working.
Added a call to the ser value of the UI control on refresh enable state of the UI floater for the preferences to the saved RenderMaxVRAMBudget.