This merges in the V1.0 poser + changes since the last beta
* a UI refactor (from angeldark raymaker)
* unified undo/redo history (angeldark raymaker)
* toggle to allow enable/disable of visual manipulator (beq)
* undo/redo keyboard accelerator support (ctrl-z/ctrl-y)
* improved focus loss/gain handing
TODO: when another tool is used (edit tools) the floater still thinks visuals are active, toggling it fixes this but it can be handled better
This reverts commit f2b751419f, reversing
changes made to 4520e92f21.
While this does fix the problem, it ignores the reason why a deferred resize was previously employed.
The correct fix is to fix the broken display() function.
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.
Shadows were not updating correctly when the RenderShadowResolutionScale setting was changed in-session, leading to broken shadows.
This commit changes the signal listener for "RenderShadowResolutionScale" in llviewercontrol.cpp from `handleShadowsResized` to `handleSetShaderChanged`.
`handleSetShaderChanged` ensures a full shader update, which is necessary for this setting to take effect immediately, similar to other render settings like RenderDeferredSSAO.
This fix ensures shadows update correctly when the resolution scale is changed without requiring a viewer restart.