-
Notifications
You must be signed in to change notification settings - Fork 844
[HDRP][Compositor] Fix issues with compositor's undo #3100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
77bae01
Fixed Render Graph immediate mode. (#3033)
JulienIgnace-Unity 47bd6c2
Fix issue with shadow mask and area lights (#3019)
FrancescoC-unity 88daab3
Fix issue with capture callback (now includes post processing results…
pmavridis 4313b48
[HDRP] Fix decal draw order for ShaderGraph decal materials (#3018)
alelievr a9c4c27
Fixed various Look Dev issues after exiting Playmode (#2956)
JulienIgnace-Unity d358740
Merge branch 'master' into hd/bugfix
sebastienlagarde 11b5984
Merge branch 'master' into hd/bugfix
sebastienlagarde a22cfa4
StackLit: Fix SG surface option property block to only display energy…
slunity a3c36a5
Fixed missing BeginCameraRendering call for custom render mode of a C…
sebastienlagarde 6cb6820
Implement custom drawer for layer mask parameters (#3066)
adrien-de-tocqueville ccf4f96
Adding mixed light baking shadowmask test (#3052)
remi-chapelain 6149540
Changed the clamping approach for RTR and RTGI (in both perf and qual…
anisunity cf36177
Fixed the condition on temporal accumulation in the reflection denois…
anisunity 5fecd49
Changed the warning message for ray traced area shadows (case 1303410…
anisunity 55bb6ff
Disabled specular occlusion for what we consider medium and larger sc…
anisunity fd53759
Merge branch 'master' into hd/bugfix
sebastienlagarde f3699e8
Merge branch 'master' into hd/bugfix
sebastienlagarde fc057cd
Fix issues with compositor's undo
pmavridis c94bb6a
Add fail-safe call to clear teh camera cache
pmavridis 52e6143
Merge remote-tracking branch 'origin/hd/bugfix' into HDRP/fix-composi…
pmavridis 4deb26e
Fix bad merge
pmavridis b9da5fa
Hd/fix 1299116 tesselation cull (#3057)
kecho 5b57f64
Change the source value for the ray tracing frame index iterator from…
anisunity b21345b
[HDRP] Added a RenderGraph pass that resets the camera size after the…
alelievr 9581f38
Fix Light Intensity UI Prefab Override Application (1299563) (#3061)
johnpars 525ebf5
Fix Undo/Redo Stability for Light Temperature (1304176, 1301076) (#3079)
johnpars 8007c48
Fix labels style (#3046)
adrien-de-tocqueville 2df0185
Fixed side effect on styles during compositor rendering. (#3081)
adrien-de-tocqueville bf833ce
[HDRP][Compositor] Fix size and spacing of compositor info boxes (#3101)
pmavridis 7be5e6c
[HDRP][Compositor] Fix color picker UI glitch in the Graphics Composi…
pmavridis 6413dc6
Fix 1299233 ies resize bug (#3094)
skhiat 8998567
filter for xbone addded (#3116)
martint-unity 027cb37
[Yamato] Enable cache server for standalone build jobs (#3106)
sophiaaar 6429445
Fix undo redo on layered lit editor (#3059)
adrien-de-tocqueville d910dc8
Merge branch 'master' into hd/bugfix
sebastienlagarde 9c216c8
[HDRP] Added Vulkan install in system requirements (#3122)
alelievr 8dbde86
[HDRP] Fix issue with compositor related custom passes (#3055)
pmavridis a5a6590
Fixed some render texture leaks. (#3050)
JulienIgnace-Unity 229f3e8
Hd/fix wizard runtime resources (#3123)
RSlysz 0a42f9b
[HDRP] Fixed lookdev reload bug when viewing a scene object (#3108)
alelievr eb1d074
[HDRP] Fix error in Depth Of Field near radius blur calculation (#3131)
pmavridis 22b5b7f
[HDRP] Fix GC allocs (#3136)
pmavridis 8cd8fe6
Revert: Fix 1299233 ies resize bug (#3094)
sebastienlagarde 9bcb75f
Merge branch 'master' into hd/bugfix
sebastienlagarde 31defd2
Merge branch 'master' into hd/bugfix
sebastienlagarde 6dffbc8
Hide light shadow near plane gizmo when shadows are disabled (#3114)
adrien-de-tocqueville c2262da
Merge remote-tracking branch 'origin/hd/bugfix' into HDRP/fix-composi…
pmavridis 161f400
Fixed undo when adding/removing layers
pmavridis 3ef5fce
Fix AOV crash
pmavridis 9702e6e
Removed unnecessaryusing directives + changelog update
pmavridis 78a0264
Do not change the selected layer after undo
pmavridis 8007ed6
Merge branch 'master' into HDRP/fix-compositor-undo
sebastienlagarde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
80 changes: 80 additions & 0 deletions
80
com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositorCameraRegistry.cs
This file contains hidden or 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,80 @@ | ||
using System.Collections.Generic; | ||
using UnityEngine.Rendering; | ||
using UnityEngine.Rendering.HighDefinition; | ||
|
||
namespace UnityEngine.Rendering.HighDefinition.Compositor | ||
{ | ||
// Internal class to keep track of compositor allocated cameras. | ||
// Required to properly manage cameras that are deleted or "ressurected" by undo/redo operations. | ||
class CompositorCameraRegistry | ||
{ | ||
static List<Camera> s_CompositorManagedCameras = new List<Camera>(); | ||
static private CompositorCameraRegistry s_CompositorCameraRegistry; | ||
static public CompositorCameraRegistry GetInstance() => | ||
s_CompositorCameraRegistry ?? (s_CompositorCameraRegistry = new CompositorCameraRegistry()); | ||
|
||
// Keeps track of compositor allocated cameras | ||
internal void RegisterInternalCamera(Camera camera) | ||
{ | ||
s_CompositorManagedCameras.Add(camera); | ||
} | ||
internal void UnregisterInternalCamera(Camera camera) | ||
{ | ||
s_CompositorManagedCameras.Remove(camera); | ||
} | ||
|
||
// Checks for any compositor allocated cameras that are now unused and frees their resources. | ||
internal void CleanUpCameraOrphans(List<CompositorLayer> layers = null) | ||
{ | ||
s_CompositorManagedCameras.RemoveAll(x => x == null); | ||
|
||
for (int i = s_CompositorManagedCameras.Count - 1; i >= 0; i--) | ||
{ | ||
bool found = false; | ||
if (layers != null) | ||
{ | ||
foreach (var layer in layers) | ||
{ | ||
if (s_CompositorManagedCameras[i].Equals(layer.camera)) | ||
{ | ||
found = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
// If the camera is not used by any layer anymore, then destroy it | ||
if (found == false && s_CompositorManagedCameras[i] != null) | ||
{ | ||
var cameraData = s_CompositorManagedCameras[i].GetComponent<HDAdditionalCameraData>(); | ||
if (cameraData) | ||
{ | ||
CoreUtils.Destroy(cameraData); | ||
} | ||
s_CompositorManagedCameras[i].targetTexture = null; | ||
CoreUtils.Destroy(s_CompositorManagedCameras[i]); | ||
s_CompositorManagedCameras.RemoveAt(i); | ||
} | ||
} | ||
|
||
if (layers != null) | ||
{ | ||
foreach (var layer in layers) | ||
{ | ||
if (layer != null && !s_CompositorManagedCameras.Contains(layer.camera)) | ||
{ | ||
s_CompositorManagedCameras.Add(layer.camera); | ||
} | ||
} | ||
} | ||
} | ||
|
||
internal void PrinCameraIDs() | ||
{ | ||
for (int i = s_CompositorManagedCameras.Count - 1; i >= 0; i--) | ||
{ | ||
var id = s_CompositorManagedCameras[i] ? s_CompositorManagedCameras[i].GetInstanceID() : 0; | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...nity.render-pipelines.high-definition/Runtime/Compositor/CompositorCameraRegistry.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This assignment was always creating an undo action, so we now do it only if necessary.