Lightmapper ( Release 0.57)

Hello! :slight_smile:

I´m working in a new ( and easier ) way to make lightmaps in Blender.
Seeing how UDK and Unity ( ver 3.0 ) do Lightmaps i see how easy it can be for ours too and decide make some like that.

So what that script do?
-> Group objects to make only one lightmap texture ( automatic balanced groups in future to save scale/resolution of texture )
-> Automatic make the new texture, uvwarp, texture configurations e assignments
-> You can choose AO or Shadow maps ( Both in the same pass in future )
-> Don´t make noise in your previous material configuration ( textures, outers uv maps etc )

So, just add the objets to group and click in “Make Lightmap” and press P to see it working in BGE :smiley:

More Options:

-> Separete : Separate all isolated objects of group in the end of lightmap generation

-> Preserve UV : Don´t calculate the UV Warp, useful case you can edit manually the UV or save time if you already have a good UV.

-> Update List: Clear all objects that are in list and don´t have in scene. ( in case you exclude or join objects of list )

Some Screens:

Various objects with different material configurations ( with/without textures, uvmaps etc ) and softshadows
http://a.imageshack.us/img690/7901/ver05wip3.th.jpg

AO basead in Raytrace
http://a.imageshack.us/img713/8497/ver05wip1.th.jpg

AO Based in Aproximated
http://a.imageshack.us/img39/4866/ver05wip2.th.jpg

Related bugs and outers issues:

-> UV layer assignment in texture/image don´t work, i´m doing manually for now, cleaning the uv layer ( the list of available uv layers ) in texture/mapping tab and applying again

-> We can´t render AO and Shadow maps in the same time yet, but will do in future. ( making 2 lightmaps and applying all of course )

So i hope you like that and be useful when finished.
i will release a version soon

Thanks to Dalai Felinto to all support in Blender API and fix some bugs in Blender Source :slight_smile:

Edit: 2011/01/24
Last version ( 0.57 ): http://wiki.blender.org/uploads/8/8b/Lightmapper.rar
Wiki: http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Render/Lightmapper

Sorry my bad English :o
Bye! :slight_smile:

nice! :slight_smile: thanks for working on this…

http://blenderartists.org/forum/showthread.php?t=128467&highlight=lightmap
i think for good lightmaps you also need a special unwrapper like this, since only then you can get a consistent lightmap resolution. it’s how lightmappers like gile[s] do it. maybe you can port it to 2.5 too?

I can’t say how much I’m looking forward to a release. Baking shadowmaps and AO always has been pretty time consuming when you had many objects so I was a bit envious of Unity and UDK. Until we get parallel sunlight in BGE this might be one of the most useful things to quickly improve a BGE game graphicswise.
Thanks a lot. I you find the time, could you post pictures of a scene with more detailed meshes?

i think for good lightmaps you also need a special unwrapper like this, since only then you can get a consistent lightmap resolution. it’s how lightmappers like gile[s] do it. maybe you can port it to 2.5 too?

I´m waiting that someone add that to Blender for i apply in my script, but if not, i guess i can do that.
A new unwrap script is really necessary, the original UV smart project is not so good to lightmaps
=/

Using in a real scene…
No Lightmaps

Shadows 2maps (1024 x1024)

AO 2maps (1024 x 1024 )

Bye! :slight_smile:

Hi Vitor !

I think one of the things Campbell (ideasman42) implemented in his lightmap script for Blender 2.49 was exactly a better UV Unwrap. Unlike traditional Smart UV Projection, for lightmaps you don’t need the faces to be connected and they can even keep their proportion (with a button to set the ratio of variation maybe?) I have no idea how he did it, but it’s worth taking a look at it.

Now on the other hand, it could be an interesting operator - “LightMap Unwrap”. So you can even try to implement that independently (as an operator instead of an internal function), and them integrate it with your workflow.

Cheers

Lightmapper 0.52 Released

-> All critical bugs fixed
-> Add Render Pass: AO, Shadows, Both ( Indirect Light in Future )
-> Fixed minor bugs

Don´t work with Blender 2.53 Beta, only with new builds, download one in Graphicall.org

Video
Release 0.52 in Paste All

sweet! good job.

This is really good work, cant wait to give it a go :yes:
Lightmaps have always been a bulky process to get though, this looks much more streamlined. Im glad you made everything optional as well, like automatic UV unwrap, cause I prefer to do all the unwrapping myself :cool:

I hope this becomes part of the official release when its more complete?

Lightmaps have always been a bulky process to get though, this looks much more streamlined. Im glad you made everything optional as well, like automatic UV unwrap, cause I prefer to do all the unwrapping myself
You can edit the UV by yourself with the “preserve UV” button, if it´s ON the algorithm do not recalculate the UV.

I hope this becomes part of the official release when its more complete?
I hope that too :slight_smile:

Thanks all to comments.

News:
Release 0.53
http://www.pasteXall.org/15389/python

Youtube Video

Change Logs:
-> smaller texture names ( less chance of bugs by large names )
-> Add Dynamic Preview:
-> minor bug fixes

yeah!

really cool script! thankyou :slight_smile:

that’s not true. it’s much better if they are connected as much as possible. saves space and reduces seam problems.

for good light map unwraps you need to use an algorithm that uses a fixed resolution (e.g. 1 meter = 20 pixels on the light map) and automatically adds additional light map textures if the space runs out. like the script you can find if you follow the link i posted.


for light mapping it would also be cool if there were an additional baking mode in blender. [shadows + lighting]. at the moment you always have to create a special white/gray material which is annoying.

if you bake [shadows] then you have no light map but a shadow map. :slight_smile:

Server for 0.53 doesn’t work for me (when i click on link http://www.pastexall.org/15389/python i get only error).

remove the X in paste"X"all.
This forum remove any link of paste all :rolleyes:

Ohh ok thenk you :slight_smile:

Can this be written for game engine? I mean if you have “day night” scene and you have map cut in few parts (so it loads when you go to other part) that in other parts that you are not in, script would work every 5 or 10 minutes (for example) so it would make new shadows depending on the sun, so they arent always the same (like in commercial games… it’s really interesting to know how they make this)?

Can this be written for game engine?
BGE use OpenGL/GPU, lightmap is a process by Raytrace/CPU, and it´s really slow process, use this in realtime is not a good idea.
What we need for BGE is a good shadow system like Cascaded Shadowmaps
Updates:
Lightmapper 0.54 - http://www.pasteXall.org/15449/python

-> Add Group system
-> Fixed bugs in Dynamic Preview
-> Add Select Objects button to select in scene the group objects

hi
I would like to have this in our svn.
if you can join Blender Projects then http://projects.blender.org/projects/bf-extensions/
we can get this inside Blender as an included add on.
thanks

Hmm this casscaded shadowmpas look interesting.

New Release: 2.5.4
http://www.paste all.org/15622/python

Release Log:
-> Add support do Blender 2.5.4

To Do List:

-> We need a better Unwarp yet, the results with many polys is very bad :frowning:
-> We don´t have a way to Bake just Indirect Light yet

Meta Androcto: Is my goal have that in contrib or as a fixed add-on, when i have some more stable i will send it :slight_smile:

Bye! xD

Looks great, thanks for your work!

How do I activate it? I put the script in my addons folder, but I can’t find it in user prefs -> addons.

Edit: of course, just after posting it ocurred to me to run it from the text editor, which works. So, is this the correct way to run it at the moment?