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 FrozenImpact · Jul 29, 2014 at 10:11 AM · runtimelightmappingbaking

Lightmapping; Baking in runtime

Hello! :)

I am making a voxel game, and so far, as I understand, lightmapping and baking can be done in the editor, by selecting the light sources, the terrains and then baking everything. However, I do not have anything in the Unity editor to bake, because terrain is generated at runtime.

Because google has not yielded anything in regards to baking at runtime, how can I bake my terrain after I have created it after running the game?

Basically, lets say it creates 4 chunks, and the game/map has a directional light, how can I script it so that lightmapping and baking starts after the terrain is generated?

Thank you! :)

BONUS QUESTION:

There seems to be this bug: alt text

It seems like the shadows arent properly displaying at these type of locations, I assume this is due to not having shadows baked, am i correct? Adjusting the Bias also didnt help

Edit: I adjusted the light bias to show the problem more clearly: alt text

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 cshan · Oct 13, 2014 at 06:20 AM 0
Share

I have the same questions, looking forward the answers.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Tanshaydar · Oct 13, 2014 at 05:59 PM

Lightmapping on runtime, even if it was possible, is not a good idea. See, thebeast.exe (32 or 64 bit) runs exclusively after you send your mesh renderers into its queue, and it starts to process them, using around 95% of your CPU and 3-4 GB Ram at the very least, making game (even the editor) unplayable / unusable.

So, here, lightmapping on runtime is not the answer to your question. You can either create chunks and lightmap them, then instantiate them to build something bigger, or stick to dynamic lightning.

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 MrSoad · Oct 13, 2014 at 06:27 PM 0
Share

Tanshaydar is correct. Baking is not a run time feature. It is designed to produce shadows at a lower performance cost than real time shadows by doing all the shadow calculations not at run time, producing lightmaps that affect the brightness of your textures. It is very power hungry when run and can kill my laptop for a day when generating the lightmaps for a simple scene. You need to look at realtime shadows for this, if you have Unity Pro. If not you need to create sections of terrain that join up seamlessly with each other. Bake each section. Then create your terrain by random assembly of these pre-baked/created sections at run time.

avatar image MrSoad · Oct 13, 2014 at 06:31 PM 0
Share

The gap you see is a baking issue that you sometimes get when the meshes(objects) in the scene that are being baked are not connected(all one single mesh). You can reduce this by overlapping your objects, or putting other objects in your scene while baking which you delete after. Or failing that join your meshes together.

avatar image Raptosauru5 · Jul 14, 2020 at 06:04 AM 0
Share

I am making a game where first you have map editor where you build voxel terrain and then you hit the button to compute lighting and other stuff where player can wait a bit. For this I need to do baking at runtime and answering this question would actually help me a lot ins$$anonymous$$d of saying that it is "bad idea"

avatar image TanselAltinel Raptosauru5 · Jul 14, 2020 at 07:51 AM 0
Share

This is a 6 years old question with an answer specific to that question. If you're gonna complain that you don't like the answer, either answer it yourself, or ask another question, because the person who answered 6 years ago could not possibly foresee your today need, don't you think?

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

7 People are following this question.

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

Related Questions

Why Lightmap disappear when i press Play ? 1 Answer

Lightmapping Problem 0 Answers

Scene gets darker after baking lightmap 2 Answers

Do I still need lightmaps? 1 Answer

Lightmaps on mobile inconsistant 4 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