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
1
Question by robinking · Jul 20, 2010 at 11:44 AM · runtimelightmap

Can I create lightmaps at runtime?

I'm working on a geo-mod style system, destructible buildings etc. If I change the meshes included in a building, what's the best way I can update the lighting to be realistic and fast? I find the realtime lights a bit jagged for my taste and maybe they're too computationally expensive. I'm guessing I will have to make my own functions for calculating lightmap data and create my own lightmap shaders... I can calculate a bit each frame (I'm doing that for the mesh destruction anyway), then swap out the textures once calculated.

My question is this: am I making life too complicated? Is there an easier/better way? I am thinking of getting Unity 3 Pro - is the realtime lighting of a good enough quality and fast enough to handle this? I do however want to publish to iPhone so I guess I need lightmaps anyway...

So that's about five questions in one!

Comment
Add comment · Show 5
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 Cyclops · Jul 20, 2010 at 03:44 PM 0
Share

Any reason this is downvoted/close-voted? Is it a duplicate? The content seems reasonable anyway.

avatar image Mike 3 · Jul 21, 2010 at 12:31 PM 0
Share

The close dialog shows it's a dupe of this: http://answers.unity3d.com/questions/15311/how-can-i-bake-a-lightmap-at-runtime-using-new-unity-3

avatar image Cyclops · Jul 21, 2010 at 01:42 PM 0
Share

Ah - I saw the word bake in Related, thought it was a different process. Shows what I know about lightmaps. :) (also it was about Unity 3).

avatar image robinking · Jul 21, 2010 at 02:22 PM 0
Share

I did see that question. I don't believe $$anonymous$$e duplicates it - it's related, maybe. I wasn't asking if it is possible to bake at runtime with Unity's own baking tools. I was enquiring about the relative complexity of using pixel lights vs creating/updating lightmaps with my own custom runtime functions.

avatar image Cyclops · Jul 21, 2010 at 06:08 PM 0
Share

Sounds different to me...

3 Replies

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

Answer by AliAzin · Jul 20, 2010 at 12:05 PM

maybe this can help. it uses VPL data and shadowmaps.

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 robinking · Jul 21, 2010 at 11:24 AM 0
Share

Interesting, thanks for the link.

avatar image
1

Answer by Mike 3 · Jul 20, 2010 at 01:20 PM

You are making life too complicated, yes. Unity 3's Deferred Rendering should make using pixel lights much faster, and the quality will be improved from Unity 2

On the other hand, you want to build on iPhone - I'm not sure if deferred lighting will work, but forward rendering should still be faster than unity 2, and look better.

There shouldn't really be any need to bake lightmaps at runtime, which would be excessively slow anyway (Especially on an iPhone if it were even possible, you'd be waiting an hour to get similar results to a few point lights)

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 robinking · Jul 21, 2010 at 11:32 AM 0
Share

Good news about the deferred rendering... however won't I still need to change the lightmaps? I understood that in Unity 3, lightmaps take over at a certain distance.

And on iPhone - when you say forward rendering will still look better, what about the core problem that I need to change the lighting arbitrarily at runtime? I can't just use normal system lights as they go through walls, so I still need lightmaps (don't I?) And they have to change arbitrarily as I blow chunks out of walls.

avatar image Mike 3 · Jul 21, 2010 at 12:30 PM 0
Share

lightmaps only take over at a distance if you use lightmaps. as for iphone, it's still a problem i guess, but i can't imagine lightmaps helping at all - you'd need to make a different lightmap for each permutation of chunks blown out of a wall. my guess would be to not worry about the light bleeding through, any attempts to fix it would most likely make the game unplayably slow

avatar image robinking · Jul 21, 2010 at 02:25 PM 0
Share

Ok, didn't realise that first bit. As for permutations, I was thinking more of calculating new lightmaps on the fly. The important point is that I would do it not all in one frame, but with my own custom functions for doing a certain number of lumels per frame, thus calculating the new lightmap over a period of a few seconds. That's what I'm doing for the meshes.

avatar image Mike 3 · Jul 21, 2010 at 03:13 PM 0
Share

In that case it could work, but it's not going to be possible using the built in lightmapper (Which you've probably figured out by now)

avatar image
0

Answer by fherbst · Jul 20, 2010 at 01:01 PM

Clicking on your "lightmap" tag, I got this answer as the first. So, with the included methods in Unity, it isn't possible to bake the lightmap at runtime.

What you could do is baking several lightmaps in the editor - one for the normal building, one for the destructed one, and then only swap these textures.

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 robinking · Jul 21, 2010 at 11:26 AM 0
Share

The intention is to make my own procedures for generating lightmaps on the fly - especially as the destruction is not pre-generated...

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

No one has followed this question yet.

Related Questions

Swapping lightmaps during runtime? 1 Answer

How to swap lightmaps? 1 Answer

Run-time lightmap generating for procedural terrain 1 Answer

Add lightmap at runtime has problem on iOS 0 Answers

change lightmaps at run time? 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