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 jnt · Mar 11, 2015 at 02:53 AM · lightmappingload levelloadleveladditive

How to load enlighten lightmaps correctly at runtime?

We are attempting to make a game that will consist of an "endless world" of sections that are loaded at runtime.

Each section will be contained in a scene with it's own lightmaps. Currently we are using the LoadLevelAdditiveAsync method to test loading the scenes into an empty 'loading' scene. First we load the scenes, then we load the baked lightmaps from each scene into the LightmapData array, then we assign each renderer in the scene to look at it's corresponding lightmapIndex, and we set the lightmapScaleOffset back to it's original value.

Here is a video of the one time that I actually managed to get it working... but I haven't been able to get it to work since.

http://youtu.be/E5jdWa2ydmA

Here is a video using another scene with my own meshes. (to test that UV mapping of unity primitives wasn't the problem). The first part shows the scenes with their lightmaps perfectly applied - no lights in the scene. The next part shows the loading scene with the scenes loaded side by side and lightmaps applied. As you can see, the lightmaps come in at the wrong scale and placement.

http://youtu.be/YS9A_WO8-NA

There are a couple of things I have noticed that I'd like someone to please explain to me or give me some insight on:

  1. No matter what value we set the lightmapScaleOffset value to, it doesn't change how the lightmap is loaded onto the renderers. So then my question is, what does the lightmapScaleOffset actually do?

  2. When I place a Lightmap Snapshot from one of the lightmapped scenes into the Lightmaps section of the 'loading" scene, the scene that the snapshot came from loads correctly.

  3. I opened the LightmapSnapshot.asset file as text, and I noticed that there are some promising looking attributes in Enlighten System Information: rendererIndex, rendererSize, atlasIndex, atlasOffsetX, atlasOffsetY. Would it be at all possible to use the attributes to set up our loaded lightmaps correctly?

Any insight or solutions to this problem would be much appreciated ;)

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 JanusMirith · Mar 12, 2015 at 12:46 AM 1
Share

I hope you manage to work something out.

avatar image jnt · Mar 12, 2015 at 09:11 AM 0
Share

A small update. As makes sense, if your GameObject is set to static, at runtime it becomes a combined mesh object in the inpector, but this also seems to affect the lightmap UVs. Ins$$anonymous$$d of setting the gameobject as static, if you rather go into the lighting window and set the renderers as 'Lightmap Static' and "Preserve UVs', then the 'lightmapScaleOffset' value in the renderer does have an effect, but still not right.

alt text

lightmapscaleoffset.png (313.2 kB)

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by JanusMirith · Mar 12, 2015 at 12:45 AM

Turns out it is a bug:

Unity bug tracker http://issuetracker.unity3d.com/issues/gi-is-broken-if-loadleveladditive-is-used

Forum post http://forum.unity3d.com/threads/gi-and-additive-scene-loading.286807/

I think the only way to fix this is to Vote for the bug, I am surprised that there is so few votes on it so far.

If anyone manages to get a fix please share, at the moment my only options are to go through all of my scenes and strip every light or push the minimum requirements up to that of a supercomputer.

Comment
Add comment · Show 2 · 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 jnt · Mar 12, 2015 at 08:47 AM 0
Share

Haha! Yeah, unfortunately those seem to be the only options for now...

Thanks for the info. Those 2 links you posted are linked to the same thread, are they supposed to be the same?

As much as it might be a bug, it's also about not having access to all the properties. If we could access the lightmap snapshot, we might be able to get around the problem.

avatar image JanusMirith · Mar 13, 2015 at 12:16 AM 0
Share

Yep, I stuffed up the link, fixed now.

avatar image
0

Answer by DarekLosu · May 20, 2015 at 11:14 AM

I've also had similar issue, but found a way around it. Try assigning lightmapScaeOffset and realtimeLightmapScaleOffset.

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 robstardotstar · Jul 13, 2016 at 04:46 PM 0
Share

On every $$anonymous$$eshRenderer in the scene?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Unreal lightmaps VS Unity lightmaps 0 Answers

Why Lightmap disappear when i press Play ? 1 Answer

Realtime Light not working on Standard Mat after Lightbake 2 Answers

Directional lightmap in custom shader. 1 Answer

How to use Occlusion Culling with LoadLevelAdditive 1 Answer


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