• 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 /
  • Help Room /
avatar image
2
Question by Zephyr-Raine · Mar 21, 2017 at 11:14 AM · unity 5performanceprefabslightmappingprocedural

Baked lightmaps in procedural game

Hello everyone! I'm currently working on a project where the level is procedurally generated. (See image). ! alt text Each of the objects in rooms are disposed by hand, then each room is stored as asset through scriptable objects (allow the use of "prefabs in prefabs"), which store reference and transform values of each prop.

At runtime, only the current room we're in and the possible adjacent ones are loaded, thus allowing for a better memory management. But here's come the lighting problem. Indeed, we'd want each room to have it's own lighting, and were considering our options.

1. Baking lightmaps : Baking lightmaps for prefabs and objects, knowing that there's no saved instance of objects but only reference to the original prefab, seems doable after some research (https://forum.unity3d.com/threads/problems-with-instantiating-baked-prefabs.324514) but would induce a quite heavy workload.

2. Instantiating dynamic lights for the current room only : We could have our dynamic lights lighten not only the dynamic gameObjects in each room at runtime, but also all the static props and objects that would not move, resulting in fastest development process, but heavier on performance.

How would we know which way to go? How terrible are dynamic lighting and which are the limits on average computer? As we're looking to save time, it seems tedious to code and test both options so we'd love some insights for more experienced users.

Many thanks! <3!

level.png (76.5 kB)
Comment
Add comment · Show 2
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 trojanfoe_ · May 11, 2017 at 08:18 AM 0
Share

I am interested in your question as I am developing a fully-procedurally-generated game.

Any developments?

avatar image Achie1 · Apr 04, 2021 at 06:39 AM 0
Share

Hi, did you have a solution for this issue? I want to do the same thing?

1 Reply

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

Answer by Zephyr-Raine · Apr 04, 2021 at 09:15 AM

What we did basically was baking each prefab individually and messing around with the API to switch lightmaps at runtime. Since then I believe lots of users encountered this problem and some even made fixes available online. I haven't looked at this but it seems to do just exactly what we wanted at the time :

https://github.com/Ayfel/PrefabLightmapping

Hope this will help you :)

Comment
Add comment · 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

160 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 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 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 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 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 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 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 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 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

Varialbes on prefab script always null 0 Answers

Spawned prefabs are sharing variables values 1 Answer

How can i make a planet in unity 5? 2 Answers

How get position from a prefab? 0 Answers

Where are the FPSController prefab's Graphics and Main Camera children in Unity 5 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