[Howto] lightmapped from blender to irrlicht

A forum to store posts deemed exceptionally wise and useful
Post Reply
kneri
Posts: 32
Joined: Sun Sep 17, 2006 4:55 pm
Location: Austria

[Howto] lightmapped from blender to irrlicht

Post by kneri »

Ok, after trying a 1000 exporters for blender to get my level lightmapped out of blender i finally had success with a very simple method.

1)Make your level in blender

2)stick the Textures on your map with the UV/Image editor
be sure that your faces wont overlay each other
best thing is to activate "draw shadow mesh" in the view menu

3)set some lights with different colors to illuminate your levelmap

4)in the buttons window -> editing (F9) -> press VertCol->Make

5)switch to the shaded draw mode for a better view on your colored lightreflections

6)When you are fine open a phytonscript window and start
scrips->uv->uvpainter

7)there you can see the same illumination than in the 3dWindow shaded
mode unwrapped to your UV - coordinates
(you have to solect the whole object)

8)Save this graphic after disabling the lines
you have to experiment with the proportions of the scriptwindow and
the winlimit button to get a good ratio and size out of it.
I dont know i wanna watch at the sript to improve this thing maybe!?

9)after this export the blenderfile to .obj

10)Open Unwrap 3D

11)There you open your file
be sure that your texture bitmaps are in the same folder than the .obj
also your exported lightmap.tga should be in this folder

12)At first you have to go to copy your UVSet1 to UVSet2
(menu "DTools->CopyUVsets)

13)Make a new material with your lightmap as a difuse bitmap

14)in the UVset2 mode just click once on the new material and you see your lightmap as background

15)scale,move your uvs to fit the figure in the background

And here comes the trick!

16)Save your file to .b3d format. In the Export window click the
textures button in the upcoming menu click for each material the
button "use as lightmap UVSet 2"

17)Import in irredit for testing
there you can add your texture as 2nd texture for each material an change the materialtype
to lightmap_light_m4
The same thing can be done by code too of corse, but i like irredit for testing

I hope my poore english is goog enougth for this "howto" thing.

thx
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

whoa! I´m impressed!! :shock: :shock: And I'm sure Vermeer will be as well.

They say the new version will support lightmapping (texture baking) so I guess it will simplify your process a bit :wink:

thanks for sharing it. I'll try to try it :wink:
kneri
Posts: 32
Joined: Sun Sep 17, 2006 4:55 pm
Location: Austria

Post by kneri »

i am still counting the days where the .b3d exporter for blender is finished..
that would be a big step for the irrlicht comunity and maybe for mankind :wink:
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

good tut

Something like this must be yet in the elder long threads of the renamed Elysiun...I've been crying for LMs in Blender (and for glueing joints to space coords, and... ;) ) for eons, but seems Ton is taking care of it. So I can finally breath. :)

'cause, kneri, while the procedure is good, trust me if i tell you that in Max or Giles, hitting a button makes it somewhate more confortable ;) I think only something good can be expected from future releases in this matter.

The vert col solution was taught by someone way long ago in those forums, but was more complex than ur tut, mainly as used radiosity and huge subdivs, etc. Besidess...was not really for lightmaps but baking light for faster renders. Aliendesc stuff is for this too.

All what need subdivs is later on probs with uvs and low pol game model accuracy...this happens often with vertex color painting baking , etc.

But imho,your procedure could come quite practical.

Only thing is..Luke has made a b3d plugin..I cannot make public, as I was a etster, and dunno if is public yet...He will tell when. And as far as I know, not only ports all character animation, but does perfect export of lightmapped meshes...Yet tho, as no multiuvs in Blender yet, I am sure he cannot add that to the plugin...unless some weird implementation whic would mean...you do a shift D of the whole textured level in Blender, dont chaneg th emesh a bit, redo the Uvs to do well for lightmap (you can force textures to have good mapping for lightmap, and just copy then) , do your tut for get a LM tga. And the script would at run time grab from mesh1 the UVs for textures+textures, and from mesh2 the UVs for lightmaps+tga lightmaps, forming an exported multiuv scene that he's already supporting in the format. But sounds terribly involved ;)
Even more. i wouldnt do it. In next release or so, a new lightmap feature comes to blender, probably, stuff must be quite direct then...

I'll give it a try to your tut; I did the otehr old way when the uv painter didnt exist, etc...

probably when lm feature is done in blender, no need of Ultimate Unwrap, which , while I have and love U3d, it'd be more compact solution...
Finally making games again!
http://www.konekogames.com
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

Alternative method:
http://blenderartists.org/forum/showthread.php?p=840508

You need a special Blender build provided by RCRuiz. Afecelis has already tried it.
Post Reply