Jump to content

Exception when optimizing scene: SetLODs: Attempting to set LOD where the screen relative size is greater then or equal to a higher detail LOD level


mroshaw
Go to solution Solved by Manny,

Recommended Posts

Hi!

 

I have a very simple scene with a number of prefab instances making up a small graveyard scene. When I run the root object through Scene Optimizer, I get the following exception:

SetLODs: Attempting to set LOD where the screen relative size is greater then or equal to a higher detail LOD level.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.OptimizeCommand:ProcessOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.Tools:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:48)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

Can you help me understand what this means?

 

Here's a link to the Graveyard asset. I'm basically optimizing the sample scene: https://assetstore.unity.com/packages/3d/environments/fantasy/pbr-graveyard-and-nature-set-2-0-58915

 

One thing that worries me about exceptions coming from Scene Optimizer, is that I'm not sure whether the process has run completely or not. When an exception occurs, does Scene Optimizer handle it? Or is my scene now in an "inconsistent" state? Do I need to resolve the issue, reset the scene, and run optimisation again?

 

Many thanks for your thoughts!

 

  • Unity: 2013.3.16f1
  • Scene Optimizer: 1.1.2
Link to comment
10 hours ago, mroshaw said:

Hi!

 

I have a very simple scene with a number of prefab instances making up a small graveyard scene. When I run the root object through Scene Optimizer, I get the following exception:

SetLODs: Attempting to set LOD where the screen relative size is greater then or equal to a higher detail LOD level.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.OptimizeCommand:ProcessOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.Tools:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:48)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

Can you help me understand what this means?

 

Here's a link to the Graveyard asset. I'm basically optimizing the sample scene: https://assetstore.unity.com/packages/3d/environments/fantasy/pbr-graveyard-and-nature-set-2-0-58915

 

One thing that worries me about exceptions coming from Scene Optimizer, is that I'm not sure whether the process has run completely or not. When an exception occurs, does Scene Optimizer handle it? Or is my scene now in an "inconsistent" state? Do I need to resolve the issue, reset the scene, and run optimisation again?

 

Many thanks for your thoughts!

 

  • Unity: 2013.3.16f1
  • Scene Optimizer: 1.1.2

Hey @mroshaw,

 

Thanks for bringing this to my attention. That is indeed some weird behavior. I'll investigate this today and get back to you!

Link to comment
9 hours ago, Manny said:

Hey @mroshaw,

 

Thanks for bringing this to my attention. That is indeed some weird behavior. I'll investigate this today and get back to you!

Thanks Manny! 

 

I'd also like to understand what to do, in general, when Scene Optimizer fails. It does look like the scene is inconsistent, and will require some manual intervention to restore the state. 

Link to comment
  • Solution
On 1/17/2023 at 7:54 PM, mroshaw said:

Thanks Manny! 

 

I'd also like to understand what to do, in general, when Scene Optimizer fails. It does look like the scene is inconsistent, and will require some manual intervention to restore the state. 

Hey @mroshaw,

After thorough investigation, I've found that the issue was related to LOD groups that were incorrectly set up in the models from the asset you are using. Since it is mostly out of our control and would be super destructive if we were to modify those assets for you, I have gone and added logic to the code to detect when this is the case in the future and warnings are issued in the inspector along with context references (to allow you to select and identify which LODGroups have this issue). 

image.png


The patch will be included in the next release once I have finalized some more fixes through Canopy. 

Hope this helps!

Link to comment

I'm going to let Nature Manufacture know that there's a problem with their LOD Group configuration in their Graveyard asset.

 

I know how hard / annoying it must be to have to accommodate for incorrect config in an unrelated asset. I guess it's the case that many users of Scene Optimizer will be using it on Asset Store scenes and models, so hopefully it doesn't do any harm to accommodate / report on incorrect config within Scene Optimizer.

  • Like 1
Link to comment

Can I just confirm, before I report this, that the issue is with the LOD Group configuration:

image.png.2255f371cc90d83545fa337a252525d8.png

Is that right? Is the fact that LOD0 and LOD1 are not in that highlighted area above the reason for the issue?

 

Sorry, I'm not entirely clear on LODs and how they should be configured.

 

Thanks!

Link to comment

That asset seems to have major issues with LOD Groups! Almost all of them seem to mirror what you've posted.

 

That said, when I "correct" the LOD Groups, I still get the error from Scene Optimizer.

 

I've taken ONE building prefab from the pack (prefab_Building_01), unpacked it into the scene, and I've amended all of the LOD Groups within that game object:

 

  • Shape
  • prefab_door_small
  • Interior
  • prefab_door_small (1)

 

I've used the same LOD Group configuration on each:

 

image.png.36887f8bcb68470c1e8362efde897d6c.png

 

When I optimize that one building game object, I still get 9 instances of the error in Scene Optimizer:

SetLODs: Attempting to set LOD where the screen relative size is greater then or equal to a higher detail LOD level.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.OptimizeCommand:ProcessOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.Tools:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:48)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

What am I missing? I figured my changes would "fix" the occurrences of the error, but they don't.

Link to comment

Yeah I too have reported it to the asset developer. It's weird that Unity allows those components to store values outside of 0-1. Nevertheless, our system will be able to detect this impurity in the future so thanks for reporting it!! 🙂 Should be out sometime today!

Link to comment
On 1/26/2023 at 12:57 AM, mroshaw said:

That asset seems to have major issues with LOD Groups! Almost all of them seem to mirror what you've posted.

 

That said, when I "correct" the LOD Groups, I still get the error from Scene Optimizer.

 

I've taken ONE building prefab from the pack (prefab_Building_01), unpacked it into the scene, and I've amended all of the LOD Groups within that game object:

 

  • Shape
  • prefab_door_small
  • Interior
  • prefab_door_small (1)

 

I've used the same LOD Group configuration on each:

 

image.png.36887f8bcb68470c1e8362efde897d6c.png

 

When I optimize that one building game object, I still get 9 instances of the error in Scene Optimizer:

SetLODs: Attempting to set LOD where the screen relative size is greater then or equal to a higher detail LOD level.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.OptimizeCommand:ProcessOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.Tools:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal,ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizerInternal:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:48)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

What am I missing? I figured my changes would "fix" the occurrences of the error, but they don't.


Yep, this is the issue that I have fixed in the upcoming version today. Once you recieve it, give it another go with Optimizing and it should highlight which objects are being effected by this issue.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...