Page 1 of 2

Lightmap Woes

PostPosted: Sat Jul 12, 2008 10:04 am
by Justintime9
I have been working on getting lightmaps to work in my age, and succeeded, although I had to try lightmaping one object like, 10 times until it worked :P. The problem began when I started setting the Lightmap as the texture of the object (in order to get it to work in URU) and when I rendered it, everything was Black... I then exported it, and sure enough, all the objects that were lightmapped turned out pitch black, no shading whatsoever... Now, I have a hunch, when I went to "Map Input">"UV:" and named the UVtexture, the name of the lightmap I just added as a texture, the whole box turned red, even though I did just what the tutorial told me to do. Anyone know what my problem is?

Re: Lightmap Woes

PostPosted: Sat Jul 12, 2008 10:24 am
by Jojon
Errr... so it works? ...or doesn't it? :7

I haven't attempted lightmapping myself, but did you enter (In the MapInput UV: box) the name of the lightmap image (and I assume you have saved the rendered lightmap and changed so that the disk file is your source image), or did you enter the name of its UV-map, as seen on the EDIT buttons panel? It should be the latter.

Re: Lightmap Woes

PostPosted: Sat Jul 12, 2008 11:25 am
by Justintime9
Well, I added a new texture to the texture window, named it, went into "Map Input" pressed "UV" and typed in the "UV:" box, I typed the name I just named the Lightmap texture in the texture pannel. However, some of the Lightmap's names were the same as the texture names I gave them, and they were all black too... so it's probably not that...
and as I said before, when I type anything other than "UVTex" in the "UV:" box, it is hilighted in red.

Re: Lightmap Woes

PostPosted: Sat Jul 12, 2008 2:37 pm
by Tsar Hoikas
Then you're not rendering onto a new UV texture properly. Reread the tutorial and do it correctly.

Re: Lightmap Woes

PostPosted: Sat Jul 12, 2008 2:39 pm
by andylegate
You have to create a new UV Map layer and name it that name.

Re: Lightmap Woes

PostPosted: Sat Jul 12, 2008 3:04 pm
by Justintime9
Tsar Hoikas wrote:Then you're not rendering onto a new UV texture properly. Reread the tutorial and do it correctly.

Well, I was doing fine until I got to that last step... It took me hours to do that, I'm not going to start all over :P
You have to create a new UV Map layer and name it that name.

Wait... you mean under the layers that say "UVTex" and "Lightmap"? under the editing buttons?

Re: Lightmap Woes

PostPosted: Sat Jul 12, 2008 5:39 pm
by Nadnerb
I'm going to drop in just long enough to echo Hoikas and say, follow the tutorial correctly. There is a difference between a UV Map and a UV Texture. The Texture is an image, the one that you rendered, and it should be light and shadow and color and such. The UV Map is the 2D mesh that represents how the image is applied to the 3D mesh. You want the name of the Map. If the box turns red, it means that you have entered an invalid name and it won't work. The name should be found in the edit panels. The default name for a new UV Map is UVTex, and UVTex.001 etc... if you actually followed the tutorial, you would have renamed UVTex.001 to "Lightmap" and that's what you should be putting in the UV: box.

Re: Lightmap Woes

PostPosted: Sat Jul 12, 2008 7:50 pm
by Justintime9
Oooooh, I see :P I'll try it again then

Re: Lightmap Woes

PostPosted: Sun Jul 13, 2008 7:04 am
by Justintime9
hmmmm... in the tutorial it says that after I save the lightmap, there should be a .001 after... but there isn't. what am I doing wrong?

Re: Lightmap Woes

PostPosted: Sun Jul 13, 2008 9:56 am
by andylegate
That doesn't always happen, and is not really important. What is important is that you save your lightmap if you are happy with it. It will be saved as a .tga file.
Go back where you saved it, and reload it while in UV Edit mode.

The steps to do this is really not that hard:

1) put the lighting in that you want to help make the light map.
2) select the object that you are making a light map for.
3) Make sure "Shadeless" is NOT turned on.
4) Uncheck ANY textures you have applied to the material.
5) Click on the little edit button, and under UV Mapping (where you have your first UV Map) click on "New"
6) Click on the 2 little boxes there on the new UV Map layer. Then rename the layer (like "Lightmap")
7) Make sure all faces of the object are selected
8) In the 3D window hit the U key to unwrap, and select either Smart Projectins (Blender 2.45) or Lightmap UVpack (Blender 2.46)
9) In the box that pops up, set the Island Margin to 0.1, then click on OK.
10) in the UV Editor Window, Selecet Image>New and pick what size you want (IE 256 x 256)
11) Hit F10 to call up the Render panel and click on "Bake"
12) after it's baked, immediatly go to the UV Editor window, and select Image>Save As and name the image you just rendered.
13) This part might seem redundant, but you MUST DO IT!!!! In the UV Editor Window, Select Image>Open and select the image you JUST SAVED!!!
14) Go back to your Materials panel. Put the check mark back in your Textures. Go to textures, and create a new image texture that is the image you just made.
15) Got back to the Materials panel, select the Map Input tab and select UV. In the UV box, type in the name of the UV layer that contains the light map you just made (type in the name you gave it in step 6)
16) Last step, go to the Map To tab and click on "Multiply"

That's it. That's all there is to it.