lightmapping using B3dPipeline

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

lightmapping using B3dPipeline

Post by jontan6 »

hello,

im trying to lightmap in 3dsmax and export to b3d (using b3d pipeline). I only found this tutorial

http://www.blitzbasic.com/Community/pos ... opic=59680

but i cant make it work. i dont understand how to do the last step on putting together the materials (diffuse in lightmap). has anyone any experience with this? please help!

anyways, what im trying to do is this:
1. model in max (we have max 7 and max 2008), because this is the modelling tool i am familiar with. my models will range from 5k to 30k polys
2. export to some format
3. apply lightmap (either in max or other tools)
4. load in irredit
5. open .irr file in my app using irrlicht engine

what i have tried:
1. lightmap using Giles - but giles chokes in loading my models. Giles seems only to work on low poly
2. lightmap using 3d world studio - i opened the trial but it doesnt import object format that i can export in max. so i need to model in 3d world studio if i go in this direction
3. my3d and 3ds max 7 - i tried for hours but i cant make it work
4. b3d pipeline and max 2008 - only 1 tutorial i found in google, and its very compact and im lost following it.

thanks in advance!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Did you try lightmapping with irrEdit? And what about blender, see the 3d graphics forum for a tutorial.
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

sorry, i forgot to mention irredit. yes i tried irredit, and its the easiest to use. but my problem is because my level has high poly, my total irrmesh filesize shoots up to almost 100mb. so it takes a lot of time to load the level (around 5minutes i think)

is lightmap in blender easy to use? my only choice of 3d format is b3d right? so i should use Gandalf exporter?

thanks!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe we should add a b3d writer to Irrlicht, which would decrease the memory consumption from .irr files.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

is lightmap in blender easy to use? my only choice of 3d format is b3d right? so i should use Gandalf exporter?
No , is not easy. But very advanced. It boils to how much interested are you on getting things done at no cost of money. But perfectly possible and , yep, Gandalf exporter.

Knowing blender, is not super complex. Is using the uv channels and the bake fuction, similar concept than in other tools.
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

1. lightmap using Giles - but giles chokes in loading my models. Giles seems only to work on low poly
I have giles, made sort of neighbourhood lightmap with it, and been done by other a large train station lightmap. It can be the material settings or some problem in the scene...

but this days I tend toprefer Blender for most tasks, except organic modeling.(prefer a miraish aproach)
Finally making games again!
http://www.konekogames.com
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

i download giles and tried again, it seems having problem importing .obj file. i created a simple mesh (sphere and added some noise to make it look like a rock), but when loaded in giles it becomes 2 dimensional (flat), and not 3d anymore. when i create object inside giles using primitives there (e.g. cylinder) it looks 3d. any prefered format to load/import in giles?

btw, i dont mind to pay some money (not too much though) but i wish its not very complicated (irredit is really very easy). any other suggested tool? my real problem is that i have already many mesh created in max, so i really need to import in lightmapper tool my mesh made in max. any suggestions? thanks very much
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, Why do you need a so high poly mesh? Can you bake the details into a low poly mesh using projection mapping ? (3DS can do this really good with the texture baking tool.

You only have to build a low poly version over your High poly mesh, set the UV and bake using projection mapping, and all the tiny details can be put into the low poly mesh (unless you big mesh as really big extrusion all over)

The team for Gears of wars had models with over 2 millions poly. They baked it onto a low poly model with less that 12,000 poly and it still looked really good.

The tutorial you mention does this:

1 - Take a model, set the scene and lights in 3DS then bake the shadowing information into a texture maps (this texture maps will be rendered in 3DS).

2 - You apply then this shadowing information into your model and export it using B3D Pipeline. For this your model should have a proper UV setup done.

So it's baking all shadows infos that you must then apply back the generated lightmap to your model and then export it in B3D after.

Have you done theses steps? If not, then you could use the generated lightmap and try to apply it in IRRedit or directly into your code.
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

thanks for the reply.

i think most of my high poly cant take advantage of baking stuff. the high polys are buildings (20-50k depending on number of stories), so its really difficult cuz no curves etc. also my scene has many objects 1-2k polys each, that when added together can combine to 100-200k polys.


i am really trying very hard to do lightmap baking in max and using b3dpipeline, but i cant make it work. im lost after the point where i have rendered the lightmap. i dont understand the instructions about uv stuff and material stuff. most tutorial i found in google does not explain well how to do this. do you know any longer tutorial for this approach?
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

well... the usual gile[s] workflow is ...importing. Close to none do any geometry actually with the few tools of giles. It's a lightmapper.

So, for sure:

a) there's a format which imports faster

b) the obj exporter you are using, adds sth into the obj ascii file (good of objs is you can compare visually as is ascii code, withthe output from other softwares) whcih produces some bad loop or sth in giles.

c) there's some weird things in the scene (do a stl check in max, dig for geometry weirdiness,like isolated vertex, and stuff that is bad in any geomerty -is bad for game engines as, as well, even worse- ) Or some Max feature you're trying to export in a brute way, instead of a inside-max bake, and the exporter is doing any crazy thing.

d) as far as I remember, the giles obj importer was not fast.

I have a very difused memories bout this in my mind: long, long, log ago since las time I used my giles. I think ASE format was being an option, from Max. But I may be wrong. You have a lot of formats, and a lot are suported by both, to go trying.

About the slowliness, change your workflow so yo import all at once and then you forget for ever, or, in parts, but if you know how to assemble later in giles, and seamlesly.I prefer the first.

Polygon count: my scene was much higher in polies than that...was slow, anyway, I remember going for a coffee for more than one occassion. A low price to pay if you're in a hurr compared to using blender, as means learning a very WHOLE 3d package, insetad of an specialized tool thought for windows users and newbie people.

Indeed, GILES is one of the easiest solutions possible for a lightmap.

If you already had some basics of blender, imo this one is more flexible.

But the radiosity in viewport is really useful in giles, among othe rthings.

Has its learning and requires you spend time and effort with the whole help doc it brings, but is doable for anyone. And theforums, do searches in their forums, extremely valuable help there.

Lightmapping process, Iam fearing you just don't know in general how to make lightmaps: and that's why is being so hard for you to do in any package. This would need a much longer explanation, so I'll give you some details instead:

you need at least two UV channels for a level with lightmaps.In most packages, is channel 1 for difuse and other sort of materials, uv channel 2 for lightmaps. Max has it in 3, surely for having the two as a first multitexturing blending one.

Anyway, I mean: you need to:

1) make the usual UVs for you difuse texture channel, the "texture" one of allways.

2) make the UVs for the channel 3, for the lightmaps. Are different, and optimizing for a lightmap. In max, you have a full dialog-window for that. Witha lot of settings to confuse you ;) You need to let it pointing to channel 3 as it's already by default. You need to put the settings to specify you bake to a file, and not a material slot if you prefer, but a separate file, well that's how I make, and specify the dimensions. The type of partitioning (the way it is gonna distribute the lit quads, to use well texture space, etc)
.You will have a button where you can specify the output folder path. Choose it and know that one is where the actual lightmap is being exported...if i remember well you then asign to another standard material, just asigned to uv channel 3. And the export to a format supporting 2 uv channels and lightmaps, which is not obj.(b3d pipeline)

But I'd recommend use your giles. And if have strength and time: Blender. But give it a nice try to giles, is quite good.

Any worflow will need quite reading and experimenting. Irredit is surely done way, way easier. Don't expect that in other tools.
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

is waay... old...
my last max deeply used was 7. this tut is of 5... things will have been strongly improved in Max 2009, but hey, some workflows keep the same, or just easier, so not bad to learn harder older ones....

http://www.translucency.com/araya/Caste ... ghtmap.htm


go clicking in next through all tutorial. I have not watched it, but seems it explains the thing, more or less.

Giles, Max, or Blender, all are valid and provide quality.
Finally making games again!
http://www.konekogames.com
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

thanks for the big effort in explaining vermeer! i appreciate it :) i will try hard again to make it work in giles. perhaps i should try as many 3d format as possible and see which works best. i am not using any special features of max. i just use simple difuse map and apply it to object.

wish me luck to make it work :)
Post Reply