Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 wayfaerer · Jan 11, 2014 at 11:36 PM · lightmapstatic

How to bake a light onto a non-static object?

First off, this feels like a simple question, but I haven't been able to find the answer anywhere.

Say I have, in Unity, a desk with a lamp on it, which is always turned on, and which just illuminates the desk a bit--in other words it isn't very bright and doesn't really affect anything else except the desk top. I want to be able to move the desk around during gameplay, but the lamp can just stay where it is on the desk (the lamp is a child of the desk). As a result, I would like to be able to bake the light just onto the table. Is that possible?

Comment
Add comment · Show 9
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 wayfaerer · Jan 14, 2014 at 02:17 AM 0
Share

Yes, I'm aware of that, but unless I misunderstood you, I don't think that's the solution. I want to be able to bake the light from the lamp onto the table, but still be able to move the table around. The reason is that no matter where the table is, the lamp light will hit it in the same way--thus I don't think the light needs to be rendered in real time.

avatar image OP_toss · Jan 14, 2014 at 02:28 AM 0
Share

Pretty sure @iwaldrop is correct with the first part. Bake to the table only. Good to go. If light is directional, no need to have realtime lighting unless you're rotating the table. This will bake just the table in the lightmaps, using just the baking lights.

avatar image iwaldrop · Jan 14, 2014 at 02:33 AM 0
Share

Well, then lets assume that you misunderstood me, because statically baked objects aren't allowed to move by default. So, bake the table, then unset the static flag via code at runtime. $$anonymous$$eep in $$anonymous$$d, however, that this is a very unorthodox kind of thing to do.

avatar image OP_toss · Jan 14, 2014 at 02:36 AM 0
Share

$$anonymous$$ark as static in lightmaps. There's different types of static. You should be able to move it after baking if it's static in lightmaps.

avatar image iwaldrop · Jan 14, 2014 at 02:58 AM 0
Share

No, you can't. Although there are several different flags, static is static is static. You have to unset the flag if you want to move the object.

Show more comments

2 Replies

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

Answer by iwaldrop · Jan 11, 2014 at 11:55 PM

You can choose to only bake selected objects. Then, in order to move the object around in the scene, it has to be reset to non-static by setting the gameObject.isStatic flag to false.

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
0

Answer by Sledzislaw · Jan 11 at 07:10 PM

Solution above is not working as expected in animated models like mine: machine with animated doors. Machine's doors are not animating anymore, no matter that they are non-static.

My fix in this case is to: 1) prepare scene as it should be set up in build, 2) disassemble machine from all moving parts, so every static surface is exposed 3) turn all problematic elements to "static" 4) clear baked data 5) generate lighting 6) undo (ctrl+z) all changes made to state from 1)

works_in_my_case :)

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.

Follow this Question

Answers Answers and Comments

21 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

Related Questions

Black stains on texture after making object static 0 Answers

Can I cast real time shadows on lightmapped objects? 2 Answers

Static object not so static... 1 Answer

Lightmap and Non-Static Object 0 Answers

Preserve lightmap on instantiated object 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