- Home /
Unity3D and Lightmapping
Hello everyone,
I saw many threads talking about lightmapping in Unity with Beast.
I am currently working on a project that need lightmapping at runtime, I mean baking at runtime not in the editor, because of not pre-built level. For me there is two solution for that :
- A realtime light mapping like this : http://www.youtube.com/watch?v=cp2fPwQPkUg.
- A calculating time like in the editor but at runtime.
Of course I am open to any ideas. I though about integrating Beast in Unity runtime but I don't know if it's possible.
Should I make my proper lightmap generator ?
Can I simulate the lightmapping system with some shaders, vertex coloring... tricks ?
Build: WebPlayer
Unity: 3.5 Pro
Thanks a lot for your help and your ideas !
The purpose of lightmapping is to prevent shadow calculation at runtime by baking at creation time.
So lightmapping at runtime would be just realtime shadowing. Or I don't understand your question.
Do you ask that because you generate levels procedurally?
It's a kind of procedural level generation. I know the aim of lightmapping. For me there is two choice. - First, a kind of realtime lightmapping like this : http://www.youtube.com/watch?v=cp2fPwQPkUg - Second, the Unity3D baking calculation system. But I don't know how to achieve those.
You should have been clearer in your question. Lightmapping is always ment to be used at runtime. You want to generate lightmaps at runtime which is unusual and not that easy.
I edited my question, I think it's clearer now. thanks for your advice.
Answer by create3dgames · Aug 10, 2012 at 08:14 PM
Unity does not have that capability, as far as I know. Just use realtime dynamic shadows in Unity Pro.
I think the only solution is to write my own runtime lightmapping system, no ?
Yes, Unity uses Beast which is part of the Editor to bake lightmaps. It is not available in the runtime. So, if you want to bake lightmaps at runtime, you have to do it yourself or find a third-party framework. I would guess there should be some out there.
What frameworks you can use depends on if you want target the webplayer (that means only 100% managed code) and maybe if you have pro (if you want to use a native code library)
The target build is WebPlayer what are the limitations ? Can I use dlls, lib ? Can I use a C dll/lib ?
No, never!
How can you even think about that :D. Native code can be anything. It would be crazy to allow a webplugin to automatically download content from an unknown source and execute native code. The only thing you can use in the webplayer are pure managed code assemblies. Unfortunately microsoft decided to give them the same file extension as native code libraries: DLL. They did the same thing with dos exe files and windows exe files... That's why you still have a dos stub at the beginning ;).
A pure .NET / $$anonymous$$ono / CIL library can be used without any problems as long as you included all dependencies. Be careful, there are mixed-mode assemblies which are essentially managed code libraries, but they use unsafe code and maybe just wrap a native code library. Such assemblies won't work. It has to be written purely in managed code. $$anonymous$$eep also in $$anonymous$$d that not all namespaces are available in the webplayer. System.IO for example won't work. If an assembly depends on it doesn't mean automatically you can't use the assembly, but if the assembly tries to use System.IO stuff you get an security exception.
See this page for a complete list of all namespaces and classes / functions which are available.
Your answer
Follow this Question
Related Questions
Lightmapping - Lightmap Resolution 1 Answer
A node in a childnode? 1 Answer
Baked Lightmap: Parts of scenes appear too dark 0 Answers
Lightmapping - Shadow power 1 Answer
Lightmapping doesn't work 1 Answer