Skip to content

Commit 7cf8c03

Browse files
Universal/fix forward to universal (#3626)
* Fixed ForwardToUniveralRendererPostProcessor script to only process UniversalRenderPipelineAsset, as well as a null check for extra safety. * Fixed SSAO_DeferredRenderer to original settings (incorrectly set to different value 5 days ago).
1 parent 9aa2e60 commit 7cf8c03

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

TestProjects/UniversalGraphicsTest/Assets/Scenes/140_SSAO/Renderers/SSAO_DeferredRenderer.asset

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MonoBehaviour:
1111
m_EditorHideFlags: 0
1212
m_Script: {fileID: 11500000, guid: f971995892640ec4f807ef396269e91e, type: 3}
1313
m_Name: SSAO_DeferredRenderer
14-
m_EditorClassIdentifier:
14+
m_EditorClassIdentifier:
1515
m_RendererFeatures:
1616
- {fileID: 3778245575090843755}
1717
m_RendererFeatureMap: 6b307b2155066f34
@@ -40,8 +40,8 @@ MonoBehaviour:
4040
failOperation: 0
4141
zFailOperation: 0
4242
m_ShadowTransparentReceive: 1
43-
m_RenderingMode: 0
44-
m_AccurateGbufferNormals: 0
43+
m_RenderingMode: 1
44+
m_AccurateGbufferNormals: 1
4545
--- !u!114 &3778245575090843755
4646
MonoBehaviour:
4747
m_ObjectHideFlags: 0
@@ -53,7 +53,7 @@ MonoBehaviour:
5353
m_EditorHideFlags: 0
5454
m_Script: {fileID: 11500000, guid: f62c9c65cf3354c93be831c8bc075510, type: 3}
5555
m_Name: NewScreenSpaceAmbientOcclusion
56-
m_EditorClassIdentifier:
56+
m_EditorClassIdentifier:
5757
m_Active: 1
5858
m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3}
5959
m_Settings:

com.unity.render-pipelines.universal/Editor/AssetPostProcessors/ForwardToUniversalRendererPostprocessor.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,22 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
3838
if (noOfFwdRendererData == 0) return;
3939

4040
//Gets all the Pipeline Assets in project
41-
Object[] allRPassets = Resources.FindObjectsOfTypeAll(typeof(RenderPipelineAsset));
41+
Object[] allRPassets = Resources.FindObjectsOfTypeAll(typeof(UniversalRenderPipelineAsset));
4242
for (int i = 0; i < allRPassets.Length; i++)
4343
{
4444
//Make some changes on the Pipeline assets
4545
//If we don't do this, the pipeline assets won't recognise the changed renderer "type", so will complain about there is no Default Renderer asset
4646
SerializedObject soAsset = new SerializedObject(allRPassets[i]);
4747
SerializedProperty scriptPropertyAsset = soAsset.FindProperty("m_RequireDepthTexture");
4848
soAsset.Update();
49-
bool tmp = scriptPropertyAsset.boolValue;
50-
scriptPropertyAsset.boolValue = !scriptPropertyAsset.boolValue; //make the changes
51-
soAsset.ApplyModifiedProperties();
52-
scriptPropertyAsset.boolValue = tmp; //revert the changes
53-
soAsset.ApplyModifiedProperties();
49+
if (scriptPropertyAsset != null)
50+
{
51+
bool tmp = scriptPropertyAsset.boolValue;
52+
scriptPropertyAsset.boolValue = !scriptPropertyAsset.boolValue; //make the changes
53+
soAsset.ApplyModifiedProperties();
54+
scriptPropertyAsset.boolValue = tmp; //revert the changes
55+
soAsset.ApplyModifiedProperties();
56+
}
5457
}
5558
}
5659
}

0 commit comments

Comments
 (0)