PDA

View Full Version : Lightmap UV's in blender?



JoshuaC
02-10-2010, 02:53 PM
Has anyone using blender been able to find a way to make these? The UV creator in the UDK seems to be working decently so far, but I'd like a little more control over my content.

styx3d
02-11-2010, 06:25 AM
In Blender when you press the u key you have in the contextual menu an option named "lighmap UVPack".

JoshuaC
02-11-2010, 11:04 AM
Thanks! I got them working perfectly.

One thing that confuses me is that alot of the tutorials say the lightmap UV's need to not overlap the main UV's. The problem with this is that in more complicated models, you don't have alot of unique space for the lightmap UV's.

Also I've been doing my own testing and it doesn't seem to make a difference if the UV's occupy the same space or not. I've had them stacked on each other, and I've had them in their own space and the lighting looks no different.

ThePriest909
02-11-2010, 12:09 PM
One thing that confuses me is that alot of the tutorials say the lightmap UV's need to not overlap the main UV's. .

I'd say that the lightmap's Uvs should not include overlapping surfaces like main Uvs do if they do. I don't think it has anything to do with main UVs.
In most of cases if any overlaping issues occur UDK will pop up that "vertex count ratio" error while importing a model.

JoshuaC
02-11-2010, 01:11 PM
I'd say that the lightmap's Uvs should not include overlapping surfaces like main Uvs do if they do. I don't think it has anything to do with main UVs.
In most of cases if any overlaping issues occur UDK will pop up that "vertex count ratio" error while importing a model.

Ooh... I've completely misunderstood what they were talking about. I thought the 2 UV's couldn't cross each other.. Now I know that the parts of the UV can't touch other parts within itself.

I feel like such an idiot.

ThePriest909
02-11-2010, 01:28 PM
Now I know that the parts of the UV can't touch other parts within itself.

That's only for lightmap's channel though, in the main one you can do whatever you like.
It took me some time to figure out what those secondary Uvs meant to be like as well so, it's not a big deal :0)

Braindrain85
08-03-2012, 01:10 PM
Hey... I tried to go with the "Lightmap Pack" Function in Blender... but an error appears which says the following:



Traceback (most recent call last):
File "C:\Program Files (x86)\Blender Foundation\Blender\2.63\scripts\startup\bl_operato rs\uvcalc_lightmap.py", line 627, in execute
return unwrap(self, context, **kwargs)
File "C:\Program Files (x86)\Blender Foundation\Blender\2.63\scripts\startup\bl_operato rs\uvcalc_lightmap.py", line 538, in unwrap
lightmap_uvpack(meshes, **kwargs)
File "C:\Program Files (x86)\Blender Foundation\Blender\2.63\scripts\startup\bl_operato rs\uvcalc_lightmap.py", line 495, in lightmap_uvpack
pretty_faces[i].place(box[0], box[1], packWidth, packHeight, margin_w, margin_h)
File "C:\Program Files (x86)\Blender Foundation\Blender\2.63\scripts\startup\bl_operato rs\uvcalc_lightmap.py", line 175, in place
set_uv(f, (x1, y1), (x1, y2 - margin_h), (x2 - margin_w, y1))
File "C:\Program Files (x86)\Blender Foundation\Blender\2.63\scripts\startup\bl_operato rs\uvcalc_lightmap.py", line 162, in set_uv
fuv = [uv_layer[i].uv for i in f.loops] # XXX25
AttributeError: 'MeshPolygon' object has no attribute 'loops'

location:<unknown location>:-1


Does anyone know what that means? Thx in advance

Dr3d1337
08-03-2012, 03:05 PM
I would suggest not using the "Lightmap Pack" for creating lightmaps in blender as it separates each quad for lighting, which could cause ugly lighting transitions on your model. I usually take my original UVW map that I used for texturing, create a new UVW layer called "Lightmap" and move the elements around and scale them to all fit on the grid without overlapping this gives the best and most accurate results in my opinion.