Page 1 of 1

Lightmaps

PostPosted: Thu Sep 05, 2013 7:21 am
by Justintime9
This.

Image

The lightmap is always getting majorly screwed up on the walls here, even though all the settings seem to be right in blender! I've even re-lightmapped it multiple times. And sometimes it will look fine, but then it'll start getting all funky again. The last thing I tried is re-lightmapping it, and then deleting the tex cache file and letting it re-compress the texture, but that did absolutely nothing. Has anyone else had this problem? I think that's happened to the picture frames in Shinelight Manor too.

Re: Lightmaps

PostPosted: Thu Sep 05, 2013 12:36 pm
by tachzusamm
Are you sure the lightmap images itself are okay?
You could check them either with an image editor, or check it in Blender.
To view in Blender how they look on the object, uncheck all texture images in the material slots of the belonging object, except the lightmap image texture itself.
Then switch the material to shadeless and change the view mode to textured. This should display your object with the lightmap only applied.

I normally get those effects when I either a) don't have a proper lightmap unwrap (keep in mind that you should use a separate UV unwrap for your lightmap, don't use the unwrap you use for the normal material texture), or when I b) forgot to switch the UV layout to lightmap instead of UVTex when I render the lightmap.

Besides that, you (again) stated that every setting seems to be correct. Well, then we could only deduce that everything IS correct, and something magical is happening. But, computer science never behaves like magic. Normally, everything works in a logical way. It would really help if you could provide us with more information about the settings you really used. Either by posting screenshots of all your settings, or by giving access to your settings by uploading part of your age (maybe only those walls).

I've rendered and used dozens to hundreds of lightmaps in my age-building life, and I can tell you they will always work as intended - as long as you use the correct settings and processing. There's no magic.

Guessing what's wrong without having any insight in your settings or workflow would require a crystal ball.

Re: Lightmaps

PostPosted: Thu Sep 05, 2013 2:49 pm
by Calena
tachzusamm wrote:Besides that, you (again) stated that every setting seems to be correct. Well, then we could only deduce that everything IS correct, and something magical is happening. But, computer science never behaves like magic. Normally, everything works in a logical way.

I've rendered and used dozens to hundreds of lightmaps in my age-building life, and I can tell you they will always work as intended - as long as you use the correct settings and processing. There's no magic.

Guessing what's wrong without having any insight in your settings or workflow would require a crystal ball.


Exactly. If you're looking for magic, you're on the wrong forum ;) . If it isn't working correctly, you have an incorrect setting somewhere. These settings are complex and precise. Read through tach's 8-page guideline found at the bottom of this post: Lightmap Baking

One thing I can think of off the top of my head is that each material having a lightmap must be set to a single user. If the material has multiple users, Blender will use the same UV map for all objects on that material. This only happens when using two UV maps with one of them assigned as a light map (ask me how long it took me to figure that out :x ). Also, pyPRP will only assign up to two UV maps per object. If you try adding a third UV map, you'll find that on export, pyPRP will default to the first UV map.

Re: Lightmaps

PostPosted: Thu Sep 05, 2013 3:25 pm
by tachzusamm
Calena wrote:If the material has multiple users, Blender will use the same UV map for all objects on that material.

Umm... no. It only seems so. Actually, it will use the same lightmap IMAGE for all objects on that material (which is again logical, because a single texture can't refer to different images at the same time).
A UV map *always* belongs to the object's mesh, never to a material.

Re: Lightmaps

PostPosted: Thu Sep 05, 2013 4:04 pm
by tachzusamm
Justin, for your convenience, here's an example Blender file which contains two objects (actually roofs from Relativity), each having multiple materials, but two separated lightmaps.

Maybe you can get the idea how it should be set up by examining the file.

http://www.texturu.org/share/Ages/LM_Example.zip


EDIT: If you loaded the file prior to this edit, you should load it again now. I made a mistake in naming the textures, which would lead to confusion (!)

Re: Lightmaps

PostPosted: Sat Sep 07, 2013 1:33 pm
by Justintime9
Thanks guys. It was actually a really easy fix. Like Calena said, it has to be a single user, and I never knew that. So it seemed very unpredictable because I never saw the connection. :D