unity-technologies / autolod Goto Github PK
View Code? Open in Web Editor NEWAutomatic LOD generation + scene optimization
License: Other
Automatic LOD generation + scene optimization
License: Other
Memory leak warnings produced during creation of LODs post import of model. Problem occurs on models of several different types including .fbx, .blend, and .obj. The warnings indicate possible memory leaks, and if an error occurs, error indicates that they are produced from the memory leak.
2019.1.02f, 2018.3.13f, 2018.3.08f
Max Exec Time 8, 15
Both Mesh Simplifies
Both Default Batchers
Max LOD Gen 3, 4 and 5
Initial LOD Max Poly 5000000, 50000000, 50000000
Model Max Poly: 190000
The error seems to occur on larger/more complex meshes that use only a few different sections/subsections as compared to a model that is broken into several sections/subsections
Tryed with Simplygon 2.5.1 for Unity side and SimplygonSDK 8.2.317.5902 for Window 10 side.
Actual statut : Crash of Unity when importing mesh.
https://image.noelshack.com/fichiers/2018/04/2/1516701127-image.png
But as you can see, i think the problem come from the Simplygon side, if someone have an idea ?
Once the meshes are baked, what's the difference?
when I dolly in and out in the scene view I notice a hiccup, is this LODGroup trademark ? I mean 5.3 shader prewarm got much better and was no longer needed plus all the lods share the same material...
Hi,
Is it possible to integrate InstantMesh Support ?
It's free :)
Destroying assets is not permitted to avoid data loss.
If you really want to remove an asset use DestroyImmediate (theObject, true);
UnityEditor.Experimental.AutoLOD.AutoLOD:RemoveLODs(MenuCommand)
Cloning
Create a new Unity project or use an existing one
From the command line change directory to your project's Assets directory.
Run git lfs clone --recursive https://github.com/Unity-Technologies/AutoLOD (Note HTTPS)
I did that what next? I don't see AutoLod in preferences
and/or default the Quadric simplifier to preserve borders
Loving these plugins so far, but running into some issues with SceneLOD on one of my projects. It's a relatively large project, and is split into multiple scenes that are loaded additively on top of each other (using the plugin https://assetstore.unity.com/packages/tools/utilities/advanced-multi-scene-cross-scene-references-47200 - though I suspect the same issue would be present just using Unity's built-in additive scene system).
As far as I can tell, SceneLOD doesn't handle multiple scenes appropriately. I've tried to make some local changes to the code base to get it working properly, but haven't been able to get it fully functional yet. Is multiple scene support something that might be handled at some point, or should I start considering coding our own HLOD system?
Firstly, nice work as for the first release.
While others are talking about Simplygon and InstaLOD, I noticed that there is also provided here the Simulated Mesh Simplifier. This one, different from other two, does not seem to require any external plugins and seems to be written from scratch.
I was trying to test a bit recently by importing high-polycount icosphere from Blender to Unity. The AutoLOD creates two additional LODs nicely. When I drag it into the scene, the main gameObject gets two child gameObject, where these two LODs are working. But when I zoom-in and out, the sphere disappears on LOD1, and appears back on the main LOD0. Is something not working here?
A LoD group of 5 levels was generated from Simplygon on local grid.
The resulting prefabs were copied into a basic scene.
The LoD Group prefab was attached to the HLoD Root public input of the Volume Script which is attached to the automatically added LODVolumeNode0 object.
The "Enable HLOD" button was clicked.
No geometry renders during play in the editor, with a basic FlyCamera moving in the scene.
I'm not sure if the LoD prefabs were connected to the AutoLoD system in the correct way, by attaching the group prefab to the HLoD root.
what is default batcher, and inital LOD max poly count?
Hello, I think I found a bug: lods scale appears to be broken if the original object has a scale not equal to (1, 1, 1) when imported.
For example:
I have a road model scaled in Blender to (0.096, 0.45, 0.45), if I import it with the AutoLOD enabled the generated lods have a strange size:
Let me know if I made any mistake or if it's a real bug, thanks! 😄
Hello,
the AutoLOD project looks very promising!!
I just added it to my actual project.
If i try to generate LODs of an fbx file in the Editor i get the following exceptions:
ArgumentException: array.Length (15) does not match the Length of this instance (14).
A Native Collection has not been disposed, resulting in a memory leak. It was allocated at V:\AREC\AUS\trunk\AUS\Assets\AutoLOD\Scripts\Helpers\WorkingMesh.cs:472.
Any suggestions whats the reason??
Unity 2018.3.0f1
thanks, sebastian
Fantastic job, this is a welcome addition to the Unity eocsystem! In the Wiki I noticed:
I imagine this refers to a case where: the meshes & textures themselves are known at edit-time (already part of the Assets/ or Resources/ folder), and it is only their instances/transforms in the scene that are determined at run-time. Is it possible to take it a step further and say: the meshes & textures are living in an AssetBundle in StreamingAssets, so are not known at all until run-time?
It sounds like a fantastic project, but it doesnt matter what objects I import or how simple they are, the editor crashes as soon as it starts the simplification/lod generation process.
Is there any important thing im missing out ?
Using unity 2018.1.0b2
UPDATE.
Downgraded to 2017.3 , it doesnt crash anymore, but, one it generates unusable meshes, and second, the meshes wont show in the scene anyway.
I guess this is "very experimental".
UPDATE 2.
It seems like some simplygon 3rd party software/plugin is required in order for this to work.
Autolod uses % decimation, it's currently hard coded at 50% of each previous LOD in the chain. It would be great to override those % in the LOD override.
Can i generate lods manually? most of my models already have lods so i don't need lods been generated.
Hi, trying to use AutoLOD with lowpoly project, but generating mesh with the default QuadricMeshSimplifier results in smoothed mesh. I spent hours trying to learn the code and trying to pinpoint the exact part where the smoothing feature is done, but couldnt find it.
Removing these files from the QuadricMeshSimplifier script results in sharp mesh, but all the colors of the model are lost.
meshSimplifier.UV1 = inputMesh.uv;
outputMesh.uv = meshSimplifier.UV1;
Hope that helps to solve the problem!
The packages didn't download, I got the folders: Packages, Packages/CCU and Packages/UnityMeshSimplifier.
But it didn't include the contents only the meta files. I can manually fix this i'm sure but it'd be nice not to have to. If this is a Github related issue like I assume when you download the zip it doesn't include submodules than that's understandable but either way you should say that somewhere if not fix it. Loving this idea though so far.
Simplygon can do decimation based on pixel size, so in theory it's possible to extract that from the LODGroup % but I don't think that's what's happening.
Could we get upload to importer non grayed out? that'll allow to fine tune the lodgroup regions and fuse them back in the asset
When I import it to my project
This error appears::
Assembly has reference to non-existent assembly 'UnityMeshSimplifier' (Assets/AutoLOD-master/Scripts/Editor/_AutoLOD-Editor.asmdef)
My Unity3d version : 2017.3.1f1
Is there any solution?
https://i.imgur.com/FcBxTyB.png
why this is wrong:
doesn't drag and drop well, when you drag lod0 in the lodgroup bucket, it'll also drag lod1,2,3 all the children
instead the hierarchy needs to be like this:
house_small
LOD0
Layer_1_LOD0
Layer_2_LOD0
LOD1
Layer_1_LOD1
Layer_2_LOD1
...
In 2018.3b2, it seems AutoLOD is creating lods in the HDRP's package folder which is read-only. This results in editor spam of the following error:
'Read only asset Packages/com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/Disc_lods.asset has no meta file.'
'Read only asset Packages/com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/Sphere_lods.asset has no meta file.'
'Read only asset Packages/com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/Quad_lods.asset has no meta file.'
I just clone this repo and getting this error.
clone https://github.com/Unity-Technologies/UnityMeshSimplifier/blob/master/LICENSE.md but still getting this error.
Assets/AutoLod/AutoLOD/Scripts/Editor/MeshSimplifiers/QuadricMeshSimplifier.cs(2,7): error CS0246: The type or namespace name `UnityMeshSimplifier' could not be found. Are you missing an assembly reference?
As an alternative to an automatic LOD generation for individual assets, could Imposters perhaps be implemented in their stead?
https://shaderbits.com/blog/octahedral-impostors/
With the advent of the new Shader-Graph situation, I would think this would be in the cards for LOD, right? D:
PS: I just wanted to yell from the top of my lungs that YOU GUYS ARE AWESOME!!! -- Thanks for looking into this LOD stuff! -- I've been wanting to make larger worlds, but Unity has been very adament about crushing my dreams on this... :(
Hello,
I'm an artist and I don't know how to use the git functions that are required to install this plugin. It'd be really cool if you guys could upload a unitypackage for people like me!
since autoLOD is already creating the asset prefab for me, it should also auto set the LODGroup
Demo Please! Dont Know How to use Scene LOD at all.
might it be possible to at-some-point think about linking/reaching out to some time-served battle-tested UAS solutions and making sure they know about the project? It would seem to be in Unity ecosphere's ethos and gives them every chance to get involved.
https://assetstore.unity.com/packages/tools/modeling/simple-lod-25366
https://assetstore.unity.com/packages/tools/quicklod-optimization-framework-16514
For examples...
: )
in hierarchy added a lodgroup with 3 lods to a cliff
reimported the cliff asset
in hierarchy added another lodgroup with 3 lods to a house
reimported the house
now simplygon keeps spawning jobs
https://i.imgur.com/f9GF3MP.png
Are they supposed to work?
Nothing happens seemingly when right clicked.
latest version
The lines have been blurred about what is UnityEngine and what is UnityEditor for awhile and this definitely came up on EditorVR. Seeing what the ECS team is doing I think it makes sense now to switch over to the Unity namespace. The assembly definition files and DLL options in the editor now allow us to pick what platforms a DLL should be loaded on.
Hello Unity Labs.
I'm having an issue using this. I have cloned, pulled dependencies and imported into a project.
But whenever It tries to run it logs this:
Can't add script behaviour LODVolume because it is an editor script. To attach a script it needs to be outside the 'Editor' folder.
UnityEngine.GameObject:.ctor(String, Type[])
LODVolume:Create() (at Assets/AutoLOD/Scripts/LODVolume.cs:187)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
and this:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.AutoLOD.SceneLOD+<UpdateOctree>c__Iterator2.MoveNext () (at Assets/AutoLOD/Scripts/Editor/SceneLOD.cs:338)
UnityEngine.Experimental.AutoLOD.TimedEnumerator.MoveNext () (at Assets/AutoLOD/Scripts/Helpers/TimedEnumerator.cs:38)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
Any ideas?
empty
but the lod0 mesh is there
https://i.imgur.com/LaLcDfE.png
Hello I come across internet and found this interesting unity tools. I planning to build on PC Standalone by Unity 2018.1.0f2. Everything works fine on editor, but when I build it resulting error:
Assets/AutoLOD/Scripts/Helpers/MonoBehaviourHelper.cs(15,40): error CS0246: The type or namespace name `ScriptableSingleton' could not be found. Are you missing an assembly reference?
What am I supposed to do to fix this? Trying to add some #if UNITY_EDITOR but doesn't work at all. Thank you.
I was really excited to find this. But unfortunately the first try is giving me really really bad results (much worse than expected). Basically just garbage with slight resemblance of the original contours.
Are there any options I can play with?
For comparison, here's an optimization to 3% using ProOptimizer in 3ds max:
I think HLOD is most important part of Game Making. Because perfomance is most important part of Game.
Unity lightmap are belong to scene. How can I bake lightmap in HLOD?
I'm getting this error, which is weird because it used to work a few weeks ago
NullReferenceException: Object reference not set to an instance of an object UnityEditor.Experimental.AutoLOD.SimplygonMeshSimplifier.Simplify (UnityEngine.Experimental.AutoLOD.WorkingMesh inputMesh, UnityEngine.Experimental.AutoLOD.WorkingMesh outputMesh, Single quality) (at Assets/Scripts/AutoLOD/Scripts/Editor/MeshSimplifiers/SimplygonMeshSimplifier.cs:48) UnityEditor.Experimental.AutoLOD.ModelImporterLODGenerator+<GenerateMeshLOD>c__AnonStorey1.<>m__0 (System.Object sender, System.ComponentModel.DoWorkEventArgs args) (at Assets/Scripts/AutoLOD/Scripts/Editor/ModelImporterLODGenerator.cs:321) System.ComponentModel.BackgroundWorker.OnDoWork (System.ComponentModel.DoWorkEventArgs e) System.ComponentModel.BackgroundWorker.ProcessWorker (System.Object argument, System.ComponentModel.AsyncOperation async, System.Threading.SendOrPostCallback callback) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary () System.ComponentModel.RunWorkerCompletedEventArgs.get_Result () UnityEditor.Experimental.AutoLOD.ModelImporterLODGenerator+<GenerateMeshLOD>c__AnonStorey1.<>m__1 (System.Object sender, System.ComponentModel.RunWorkerCompletedEventArgs args) (at Assets/Scripts/AutoLOD/Scripts/Editor/ModelImporterLODGenerator.cs:334) System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted (System.ComponentModel.RunWorkerCompletedEventArgs e) System.ComponentModel.BackgroundWorker.<CompleteWorker>m__1 (System.Object darg) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnitySynchronizationContext.cs:92) UnityEngine.UnitySynchronizationContext.Exec () (at C:/buildslave/unity/build/Runtime/Export/UnitySynchronizationContext.cs:53) UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at C:/buildslave/unity/build/Runtime/Export/UnitySynchronizationContext.cs:74)
it's like a zombie, can't kill it
I tried selecting a model with skinned mesh renderers either as a prefab in the Assets directory, or as a game object in the scene with absolutely nothing happening when running the editor script.
No errors.
Using 2018.2.5f1
Line 808 of LODVolume
is this:
var prefab = PrefabUtility.GetCorrespondingObjectFromSource(go);
This requires Unity 2018, but you don't have a corresponding compiler directive. You'll need to change this like you did in AutoLOD
:
#if UNITY_2018_2_OR_NEWER
var prefab = PrefabUtility.GetCorrespondingObjectFromSource(go);
#else
var prefab = PrefabUtility.GetPrefabParent(go);
#endif
Hey, Once I select more than ~15 objects to process at once, simplygon plugin stops. Jobs are posted one by one I guess so why this happens. Any solution to automate it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.