-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APV] Scenario blending improvements (#7198)
* Separate memory budget enum * Give control over blending factor * Allow SRP with no compute support * Added debug mode for scenario blending * Blending runtime test * reviews * Fix test * fix formatting * Fix renaming, hide active scenario from debug, fix test
- Loading branch information
1 parent
8092fd3
commit 71a6010
Showing
30 changed files
with
601 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...imeTests/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/007-BasicAPV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...untimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/007-BasicAPV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ssets/ReferenceImages/Linear/OSXPlayer_AppleSilicon/Metal/None/007-BasicAPV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ts/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/007-BasicAPV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ts/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/007-BasicAPV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
TestProjects/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/LightScenario.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using UnityEngine; | ||
using UnityEngine.Rendering; | ||
|
||
#if UNITY_EDITOR | ||
using UnityEditor; | ||
#endif | ||
|
||
[ExecuteAlways] | ||
public class LightScenario : MonoBehaviour | ||
{ | ||
const string scenario1 = "Scenario 1"; | ||
const string scenario2 = "Scenario 2"; | ||
|
||
public Color scenario1Color = Color.red; | ||
public Color scenario2Color = Color.green; | ||
|
||
void OnEnable() | ||
{ | ||
#if UNITY_EDITOR | ||
Lightmapping.bakeStarted += SetupLight; | ||
#else | ||
// Ensure Light is baked and not coming from realtime | ||
if (Application.isPlaying) | ||
GetComponent<Light>().enabled = false; | ||
#endif | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (Application.isPlaying && ProbeReferenceVolume.instance.isInitialized) | ||
{ | ||
ProbeReferenceVolume.instance.SetNumberOfCellsLoadedPerFrame(100); | ||
ProbeReferenceVolume.instance.lightingScenario = scenario1; | ||
ProbeReferenceVolume.instance.BlendLightingScenario(scenario2, 0.5f); | ||
} | ||
} | ||
|
||
#if UNITY_EDITOR | ||
void OnDisable() | ||
{ | ||
Lightmapping.bakeStarted -= SetupLight; | ||
} | ||
|
||
void SetupLight() | ||
{ | ||
var color = ProbeReferenceVolume.instance.lightingScenario == scenario1 ? scenario1Color : scenario2Color; | ||
GetComponent<Light>().color = color; | ||
} | ||
#endif | ||
} |
11 changes: 11 additions & 0 deletions
11
TestProjects/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/LightScenario.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+40 Bytes
(100%)
TestProjects/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/LightingData.asset
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...jects/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData-Default.CellData.bytes
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...RP_RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData-Default.CellOptionalData.bytes
Binary file not shown.
Binary file added
BIN
+1.62 MB
...ts/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData-Scenario 2.CellData.bytes
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
...RP_RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData-Scenario 2.CellData.bytes.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+2.02 MB
...RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData-Scenario 2.CellOptionalData.bytes
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
...meTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData-Scenario 2.CellOptionalData.bytes.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...rojects/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData.CellSharedData.bytes
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ojects/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData.CellSupportData.bytes
Binary file not shown.
Binary file modified
BIN
+72 Bytes
(100%)
TestProjects/HDRP_RuntimeTests/Assets/Scenes/007-BasicAPV/ProbeVolumeData.asset
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.