Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Baldinoboy · Jul 19, 2013 at 04:17 PM · asset storepackagelod

How to set up LODs for a Asset Store pack in Unity Indie?

I'm not making a game I'm selling models on the asset store. I plan to get Unity pro but can not afford it now.

I know I can't fully configure an LOD prefab in the free version but is there a way to set the prefabs or imports up so Unity pro will set it up?

Thanks

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Dec 09, 2013 at 05:00 PM 0
Share

I'd say the miss-directing title on your question lead to the bad unrelated question... And I guess there is no way to do what you want without Unity Pro.

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by cregox · Dec 10, 2013 at 01:48 PM

@TonyLi gave good suggestions, but here's the technical aspect of what you want to do. Quoting from http://docs.unity3d.com/Documentation/Manual/LevelOfDetail.html :

LOD-based naming conventions in the asset import pipeline In order to simplify setup of LODs, Unity has a naming convention for models that are being imported.

Simply create your meshes in your modelling tool with names ending with _LOD0, _LOD1, _LOD2, etc., and the LOD group with appropriate settings will be created for you.

Note that the convention assumes that the LOD 0 is the highest resolution model.

This should mean you can just set the naming convention and it will automatically pick up. I couldn't make it work in practice, but it should work eventually. And, even if it doesn't work, it's just drag n' drop the prefab into the lod group, quite easy.

Also, since your title is still confusing, I'll answer it separately as well, just like @inkspot did, but with code from the wiki:

 /*
 Automatically set LOD Levels of models
 (C)2010 by Tom Vogt
 Use and modify as you wish, but retain author credits (aka BSD license)
  
 == Usage ==
 * Create an empty gameobject
 * Drag all LOD levels into it, so they become children of the LOD object
 * Attach this script to the empty gameobject
 * Set the number of meshes in the script, and drag them into the slots, from highest (closest) to lowest (far away)
 * Set the number of distances to '''one less''' than the number of meshes (beyond the highest distance will use the most far away mesh automatically)
 * Set the distances at which the script shall switch to the next lowest LOD. So the first number means "at this distance or less, use the highest LOD".
 * Press Play and drag the camera around to check if your distances are fine.
 */
  
 public var Distances : float[];
 public var Models : GameObject[];
  
 private var current = -2;
  
 function Start() {
     for (var i=0; i<Models.Length; i++) {
         Models[i].SetActiveRecursively(false);
     }
 }
  
 function Update() {
     var d = Vector3.Distance(camera.main.transform.position, transform.position);
     var stage = -1;
     for (var i=0; i<Distances.Length; i++) {
         if (d<Distances[i]) {
             stage=i; 
             i=Distances.Length;
         }
     }
     if (stage==-1) stage=Distances.Length;
     if (current!=stage) {
         SetLOD(stage);
     }
 }
  
 function SetLOD(stage) {
     Models[stage].SetActiveRecursively(true);
     if (current>=0)    Models[current].SetActiveRecursively(false);
     current = stage;
 }

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Baldinoboy · Dec 10, 2013 at 09:21 PM 0
Share

It is a nice script. Stinks that it does not worked in the editor view. Side by side game and editor view works good though. Thanks for the link.

Could I use this script in my pack? Would I just leave credit and info in the readme to give credit to $$anonymous$$ Vogt in there project?

avatar image
2

Answer by TonyLi · Dec 09, 2013 at 05:12 PM

Since you're just making models to distribute on the Asset Store, here are a couple suggestions:

  1. Include the LOD meshes in the model but don't provide a prefab. Let the customer use Unity Pro to add an LODGroup and assign the meshes as appropriate. Make sure to name the meshes so it's obvious which LOD group they belong to. It's not that much extra effort for the customer.

  2. Wait until all your models are ready, and then set up the prefabs in the trial version of Pro. I'm not sure if this is legit, but it may be allowable since you're just setting up the prefabs for the convenience of Pro users, not using Pro yourself per se. You might want to check with the Asset Store folks before trying this.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Baldinoboy · Dec 10, 2013 at 04:31 AM 0
Share

Thanks for the answer TonyLi. What I've been doing is importing the LOD1 and LOD2 models and putting them in a folder under the normal models. For the textures, materials, and prefabs I do the same thing. Each LOD model has its own texture, material, and prefab. So the buyer, who has Unity Pro, can just drag the normal prefab and then the LOD prefab.

The LOD system is just drag and drop prefab right?

If I can start making some money I will get Unity Pro and set up the LODs. I will then include the LOD prefabs in an update.

Do you think that sounds logical? Sounds complicated to me but I do not really have a choice. Really wish the LOD system was in free. I already did the trial with Unity 4. Wasted it because I really wasn't into Unity then.

Thanks again for the answer.

avatar image
1

Answer by inkspot · Jul 19, 2013 at 04:50 PM

You could use the camera to get and detect the distance away from the prefab and use like thresholds to load the LOD mesh on your prefab: LOD1 loads when 50units away from camera, LOD2 loads when 100 units away from camera etc.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Baldinoboy · Jul 20, 2013 at 04:22 AM 0
Share

Yeah I know but I'm not a programmer and don't plan on selling the package with any scripts. Just want it to be set up to use the Unity LOD system.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Refund Fake Package 1 Answer

Asset Store Tools upload? 0 Answers

Importing assets breaks my game 1 Answer

asset store download blank 1 Answer

How to add and remove installed packages more easily? E.g. Google Admob. Package control in Unity? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges