x


When is Lightmapping bad for performance?

Looking to up my performance, I'm exploring lightmapping. The manual says basically it's a good thing because dynamic lights on objects will slow things down. Ok, but adding lightmaps also increases the texture usage. I'm a bit worried, esp on iPhone and Android, that the resulting lightmaps will blow my memory out.

What do you recommend?

more ▼

asked Oct 26 '10 at 11:17 PM

DaveA gravatar image

DaveA
26.8k 153 171 257

Also, I assume that after a lightbake, I remove or deactivate the lights involved in baking, right? Or is that automatic? Any advice on point vs directional vs ambient?

Oct 26 '10 at 11:18 PM DaveA

I have never tried baking in unity but if you bake the textures at the res they are at already then surely there will be absolutely no difference in performance usage from the textures?

Oct 27 '10 at 12:45 AM Will 7

@Will: lightmaps add an additional texture on top of the textures you're already using. Otherwise you couldn't use tiling for regular textures, and that's why they use a second UV set.

Oct 27 '10 at 01:55 AM Eric5h5

My recommendation is to model your shadows whenever possible. I HATE low-res lightmaps; looks like splatters of garbage. And not in a good way. :-P

See Graphicalgeek's post.

http://forum.unity3d.com/threads/35160-Share-your-thoughts-on-vertex-colors-vs.-texture-maps

Oct 27 '10 at 02:44 AM Jessy

Will, as I understand it, the more 'live' lights (not static, that is) you have, the more calculations need to be done, so lightmaps improve performance by eliminating actual lights.

Jessy, you mean make polygonal models of shadows using darker colors etc.?

Oct 27 '10 at 06:14 PM DaveA
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Use as low resolution for the lightmap as you can get away with. Typically texel size for lightmaps is far larger than you'd use for regular textures, but since the lightmaps are just shadows and general lighting information rather than detail, you can get away with it. The built-in lightmapping in Unity will tell you the texture size and VRAM usage; you can always resize the generated lightmaps later (or rebake at a lower resolution).

more ▼

answered Oct 27 '10 at 02:24 AM

Eric5h5 gravatar image

Eric5h5
81.5k 42 133 529

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x677
x431
x344
x209

asked: Oct 26 '10 at 11:17 PM

Seen: 3681 times

Last Updated: Oct 26 '10 at 11:17 PM