So lately I’ve been trying to bake lights. With a resolution of 0.3, I can bake my scene in 5-10 minutes (PC specs in signature, it is no slouch). However this isn’t enough to even show my shadows. I noticed there is a setting for Atlas Size. Changing it to 32 or 4096 didn’t seem to make any difference in my scene. Looking in the docs doesn’t really explain what the Atlas Size is, what it is for and what is the best setting for a particular scene.
What is the Atlas setting for, and how to find the ideal setting? Also, any tips on making baking faster? I don’t see why it takes so long to bake if my PC can create perfect shadows in the scene about 400 - 600 times a second during gameplay. If my games runs at 400- 600FPS with realtime shadows, I don’t see why it takes over 10 minutes to get a bake that doesn’t even show the shadows.
Can you paste the lightmap being kicked out?
Are you generating the lightmap UV’s for the objects in the scene or are they being generated by Unity?
Normally long bake times come down to the incorrect setup for the cluster. When you start to bake your lighting, are you noticing a part if the process that’s taking a long time? You can see which stage Unity’s in, by checking the bottom right corner of the Unity window.
That took 8 minutes. Since I’m baking lights I assume the UV’s are generated by Unity.
Since you’re from UT, thought I’d ask a question: Do you plan on using the GPU to bake lighting? Because when I bake lights only the CPU works, my GPU’s fan doesn’t even turn on.
Unity will only generate lightmap uvs on import if you chose to activate it.
Its not always desirable to try to generate lightmap uvs so its off by default.
(me obviously not Networking for UT but: ) The enlighten light / gi backer dos only use the cpu , so its kind of unlikely to have gpu accelerated light backing in the near future.
Well apparently Unity doesn’t think this is big enough of an issue as light baking significantly slows down project work. I guess you’re supposed to build everything first, then run a good-looking light bake over-night. If I do a resolution of 20, it takes an hour on a more-than-decent PC but I finally get some fuzzy shadows. If UT added GPU acceleration it would really speed up the process. I hope this will get in the roadmap ASAP as it is a serious setback for the game engine.
If you’re using Unity standard primitives (cubes, spheres ect…), these objects will be unwrapped ready for lightmapping. If you’re importing some custom geometry, then you’ll need to either unwrap the second set of UV’s yourself or generate them in Unity using the Generate Lightmap UVs.
That gives me a lot of very interesting homework reading to do. Can’t wait for the new rendering. I noticed after going from 5.3 to 5.4 beta that the baking is slightly faster, so I’m glad to see that Unity is making progress on light baking speed. The new progressive light mapper looks impressive, I really like that you can move objects during baking as that means you can continue developing as you’re baking lights. I still don’t understand why Unity doesn’t want to use GPU light baking, but this is a good step in the right direction. Obviously it is very complicated as that was from Unite 2014 and it is already 2016. Keep up the good work!
I’ve looked over that blog post with tips on baked lightmapping quality and speed improvement by making adjustments. It’s just overly complicated and this is coming from a developer with 9 years experience with overly complex systems. Is there some way to just create dummy proof quality presets that would handle all of these minute details for us? It’s all stuff that’s buried in settings in the lighting tab, but I feel like people need something simpler. I’ve read a billion posts on these forums, reddit and the rest of the web about how convoluted and overly complex it is to get decent baked lighting. I mean you can leave the complicated settings for power users, but maybe just expose a simple “presets” section?
True, light baking is just too hard for most people. For example, in that blog that @PeteUnity3D posted, there is “For each atlas there are five lightmaps containing direct lighting, indirect lighting, direct directionality, indirect directionality and AO respectively”. So I assume that if I make my atlas smaller, I’ll get a higher-quality light bake since my lightmaps will be smaller. However, considering that it takes only 5-10 seconds to change atlas size, I don’t think that’s the case. So the blog confused me more than anything.
Also, I wish Unity would graphically show what it is doing when baking lightmaps. For example, when baking Occlusion Culling, it shows a blue grid. This really helps you understand the size of the bake and how fast it is going. When baking lights, all we have is a little bar. 1/2 the time I’m wondering if Unity is stuck. And still, nowhere is a straight answer to why UT is avoiding the GPU for baking. If UT can’t do something, they should at least provide a good reason.
To sum this up, I just don’t think that UT is doing enough to improve baked lighting. It seems that Unity is more interested in expanding the Analytics, Cloud Build and Multiplayer and seems to have slightly forgotten that while these tools are great after making a game, we still need improvements to the game engine itself, and baked lighting is crying for attention it isn’t receiving. I’m really waiting for the PowerVR lightmap system, but right now it isn’t even in Unity 5.5 beta, meaning we will probably have to wait a year or so
Yeah I agree James. I’m used to pretty complex systems and softwares and lighting is just a pain for me - always has been - even pre-rendered setups.
Maybe they can take some tips from Mental Ray incorporation into 3D softwares.
When Mental Ray was first introduced into Max I avoided it like the plague - for 2-3 years. It wasn’t until the pretty much overhauled the entire Mental Ray system inside Max to have a ton of presets and simplified settings to get good acceptable lighting for common setups - that I started to mess with it more.
Template setups for common game genres would be awesome. Have the minute detailed settings always available, but the templates could be a great starting point - so we could get better results faster.
Presets would be awesome. I’ve baked dozens of scenes, yet as I show in this post: http://forum.unity3d.com/threads/when-baking-lighting-i-get-ugly-discolorations.427926/ you can get very ugly results for no apparent reason, while wasting a ridiculous amount of time. I feel really sorry for the people using dual-core Intel i3’s, because my quad-core Intel i7-4790 takes up to an hour to do a good bake on a simple scene. I’d be interested to see how an 8-core Xeon would bake in Unity.
Perhaps even an automatic tool that would detect good settings for the scene. Even Windows 10’s simplistic Photos app can automatically enhance photos. I understand lighting is more difficult, but automatically picking settings isn’t anything new. However if making an automatic tool is too hard, we should at least have some presets guaranteed to work.
Atlas size shouldn’t affect much apart from draw calls. It’s just an image layered over your geometry. Some devices are incapable of displaying 2/4k textures, so it lets you choose 1024 and smaller. When it fills the image with lighting, it will create another image, so the larger your image is the less it will create.
There’s nothing complex about baked lighting. Most people just don’t seem to get what it’s for and they use insane settings that are miles off of the defaults for some reason. The default settings are already your simple preset that should work most of the time.
Baking time is an issue, but remember that HL1/2 maps would take 12+ hours to “compile” back in the day if not longer and the artists had NO PREVIEW. So 1 hour in Unity technically isn’t a long time for a final bake.
Then there’s people trying to lightmap a terrain which I don’t think many AAA games have even done. They mostly used vertex lighting (UnrealEngine 2) then jumped to realtime lighting. UE3/UDK even invented a fancy custom Directional Light to deal with the problem.
In theory, there isn’t too much going on with a lightmap to make it overly complicated. The issue I was speaking about isn’t about the lightmap itself or the theory of baking lighting. It’s about a bunch of convoluted settings buried within sub settings that are not efficient by default. I will build up relatively simple environments for a mobile game, change no baking settings whatsoever and get crazy long bake times. I mean sitting for 30-40 minutes for a 4,500 triangle mobile environment using 10-12 textures. This never happened with the Beast lightmapper, it just worked out of the box. If I wanted better quality I went in and tweaked one or two settings and got better resolution lightmaps.
Now I know the new system is not Beast. All I was suggesting is that maybe some of these more detailed settings are hidden within some simple quality presets, and that these presets used already optimized settings for quicker bake times. I guess I was asking for a “smarter” light baking system. Not one I (as the end user) had to calculate all of these technical bounds for atlases, etc. Just one that calculated that for me based precisely on the mesh I provided it. One that set the UVs and lightmap atlases up so efficiently on it’s own, that my bake times were snappy and quick. I mean with the mesh data fully present, why can’t a system be very smart about how to propagate a second UV set for baked lighting?
Please excuse my wording, but after reading that, can we not agree that currently the system is sort’ve working like crap?