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 /
This question was closed Mar 27, 2014 at 08:26 AM by Andres-Fernandez for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Andres-Fernandez · Feb 18, 2014 at 04:50 PM · directional lightmap

How can I change directional lightmaps at runtime?

Hi there.

I am using lightmaps in a scene baked with directional lightmaps mode, and it generates the color and scale textures. Is there a way of changing it at runtime?

The idea is to load low resolution maps when starting the app while loading the full lightmaps from an asset bundle via WWW object. (just to minimize the size of the unity player, as it is a web project) I have searched and all I have found is the lightmapNear and lightmapFar answer (which btw was really helpful).

I have searched the docs and I am not sure what to use instead of lightmapFar and lightmapNear to set the color and scale textures. Any ideas?

Thanks in advance.

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

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by MakeCodeNow · Feb 18, 2014 at 05:51 PM

Unity stores the current set of lightmaps in LightmapSettings.Lightmaps. All lightmapped objects have an index into this array and...that's it. If you want to change the active set of lightmaps, simply change the contents of the Lightmaps array. You can modify it however you like in the editor or in game. Just know that changes you make in the editor will be overwritten when the user next bakes lightmaps.

PS - I believe that LightmapNear and LightmapFar are used with Directional Lightmaps, too. The variables should really be called LightmapSlotA and LightmapSlotB.

Comment
Add comment · Show 3 · 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 Andres-Fernandez · Feb 19, 2014 at 08:20 AM 0
Share

The names is the cofusing part. I'll give a try to setting the color texture at the lightmapFar and the scale texture at the lightmapNear (and viceversa if it doesn't work). Thanks!

avatar image MakeCodeNow · Feb 19, 2014 at 07:14 PM 0
Share

Definitely confusing. Please mark this question as answered if you got the information you needed.

avatar image Andres-Fernandez · Feb 20, 2014 at 07:52 AM 0
Share

The PS part is the key. Names are a mess but work as slots for the textures, sort of lightmapFar equals slotA and lightmapNear equals slotB.

Follow this Question

Answers Answers and Comments

19 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

Related Questions

Realtime Shadow Problem On lightmapped Object 1 Answer

Cannot bake directional lightmaps using Unity Pro. 2 Answers

Does lightmap bake the lighting for trees? 0 Answers

Stealth project: lightmapping artifacts 1 Answer

Bounces in Lightmapping is unabled to click 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