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
0
Question by hvilela · Jan 17, 2012 at 05:41 AM · lightinglightmapbakebeast

Switch Lightmaps

Is it possible to bake two different lightmaps for one scene and than switch them on the fly?

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

2 Replies

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

Answer by green_core · Jan 17, 2012 at 06:39 AM

Yes, it is. To load lightmaps on the fly you should load them to lightmaps array. Of course you should bake and save them before (to resources or to asset bundle, for instance).

Keep in mind, that each lightmap is an atlas. So, to apply two different sets of lightmaps properly you should bake them with lock atlas option. Instead that, you can save index and offset of each object and load them later, but i think it is not optimal solution.

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
avatar image
1

Answer by Vicas · Dec 20, 2013 at 02:09 PM

Check out http://wiki.unity3d.com/index.php/LightMapSwitcher :)

Comment
Add comment · Show 4 · 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 tomekkie2 · Jul 06, 2014 at 02:45 PM 0
Share

That's for dual lightmaps. How would the script change for directional lightmaps?

avatar image Vicas · Sep 11, 2014 at 12:06 PM 0
Share

You simply don't pull anything over to the "Near" slots in the Inspector. :-)

avatar image thompsongast · Oct 15, 2014 at 03:00 PM 0
Share

@Vicas, how would one go about implementing that LightmapSwitcher script? I have been fiddling around with it for a couple of hours but my program$$anonymous$$g/scripting language is very poor :') Haven't been able to get it to work yet.

Seeing its use of "Void" for its functions I would assume it is C#? Also, what is the NaturalSortComparer script that's also listed on that page for? I am using Unity pro 4.5, hope you see this!

$$anonymous$$y apologies if this is not the way to go but I strongly believe that script does what I'm looking for in my project.

avatar image psykedelius · Apr 13, 2015 at 03:53 PM 0
Share

works great with unity 4.6 but how should i made this works with unity 5 ?

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

6 People are following this question.

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

Related Questions

How to bake emissive objects into lightmap? 1 Answer

Baked light map for level appears to be dirty 1 Answer

Why realtime and lightmapping results so different? 1 Answer

Unity - Stuck in Build 7/11 Light Transport - 1 Job 13 Answers

ugly seam artifacts in beast 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