Free lightmap workflows

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

Free lightmap workflows

Post by Iaro »

Hello,

I tried to find workflows to make lightmapped scenes that could be build with free tools but are encountering problems. What i've tried :

1. Oct files exported from Blender , lightmapped in fsrad and imported in Irrlicht. The problems : oct does not yet support curved surfaces ( I think ) , i could only build lightmaps up to 128 x 128 and for example on a terrain test with many poligons the lightmaps seemed al screwed up.

2. The Mim format - managed to build a .mim file from an .obj one exported from Blender but don't know exacly the sintax to load it. ( after including the loader files in the project I still get 35 errors ).

3. Deled dmf files - Unfortunately in the LITE version lightmaps are very low resolution.

I also downloaded one of Afecelis video tutorials regarding gmax lightmapping but have some questions. The final format that is imported in Irrlicht is bsp right? Does the bsp format have limitations like for example a polygon limit ? Also is it only built for convex geometry?

Regarding the my3d file format - would it be possible to use it with Gmax + for example Yafray renderer for render to texture. Being similar to 3dsmax maybe the export scripts would work too.

And lastly are there free programs that can export lightmapped geometry to commercial formats like Cartography Shop .csm or maybe Deled .dmf ?

Feel free to share any workflows that you have and only use free tools.

Thanks in advance ,
Robert
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

"1. Oct files exported from Blender , lightmapped in fsrad and imported in Irrlicht. The problems : oct does not yet support curved surfaces ( I think ) , i could only build lightmaps up to 128 x 128 and for example on a terrain test with many poligons the lightmaps seemed al screwed up."

It is FSRAD lightmap generator what does no support curved surfaces.. The oct probably either if Murphy saw that would be a wast as FSRAD didn't consider curved surfaces to output those pixels...

I came to the conclusion the best workflow for me was : Giles (curved surfaces supported, excellent gi lightmaps ,but 50$, I think it was..) ...then export as OBJ (Gile[s] exports in the ideal way for MIM: 2 OBJs, one with texture, one with lightmap. The final MIM mesh is not a duplicated mesh, in case someone does think so. Imho is just more flexible ) , use OBJ2MIM, then use the MIM loader in your irrlicht coder (I could check it all easily not coding a single line thanks to the viewer he made for betatesting easier: first only OCT, later on one supporting MIM, I included all in the zip as he gave recently permission. )

Of course, Blenders lover could use OCT workflow, it was nicer as was fully free tools, as FSRAD is free, and could be worked out also in linux, as he modified finally -dunno if I included it, if that's the one- FSRAD so to be able to load in Wine emulator for Linux. And as all you know. And Blender linux version runs with no problems, obviously. But that path would mean no curved surfaces (better said, lightmaps not taking in consideration curved surfaces, so making a faceted baked lighting in the tga lightmap )

There was a possibility of he modifying FSRAD even more so to add curved surfaces support, but I think that'd be way a load of work, I think he told me. (Trancos made a normals supporting (curved surfaces) version of his LMTOOLS; too, but dunno what problem arised. )

So, more quality with MIM, but needed giles or any other lightmapper. What I still see as an advantage over other systems is...well, it imports OBJs, which being so standard, together with TGAs and other texture formats, MIM tools can use the export of any highend or low end package. Even Blender. That is : Blender can do real game lightmaps, as doesn't have multi UV texturing,(recently there's work in that direction, I think by a plugin, quite new) but can bake the lighting into channel UV 1, so in theory you could do the 2 OBJ exports from Blender (and blender support curved surfaces in render) , one in grays without actual textures, export as OBJ, another only with real textures attached. You don't need to have same UVs (actually "UVing" for lightmaps is quite different and such a pain to make by hand: Imho the automatic uv lightmap system of FSRAD is quite better than for example, Max one. ) I haven't tested this way, but maybe would work.I have done similar things with other packages.


" 2. The Mim format - managed to build a .mim file from an .obj one exported from Blender but don't know exacly the sintax to load it. ( after including the loader files in the project I still get 35 errors ). "


Dunno what happened there...my OBJs converted by obj2mim always worked in irrlicht later on...maybe there's a problem at some point, the kind of OBJ export, a parameter of obj2, or your loader/codiing.

The FSRAD and OCT having only 128x128 allways scared me also, but actually fsrad does an splendid lightmap partitioning and result tends to be really good when u start to control it...


"3. Deled dmf files - Unfortunately in the LITE version lightmaps are very low resolution."

It was 16x16, if I remember well...


"I also downloaded one of Afecelis video tutorials regarding gmax lightmapping but have some questions. The final format that is imported in Irrlicht is bsp right? Does the bsp format have limitations like for example a polygon limit ? Also is it only built for convex geometry?"


yep, convex geometry. No isolated faces or the like. The old bsps where limited to dunno if 64x64 or 128x128...but again, the system to do the stuff was surely very good, and..a lot of blur to hide some problems, I suppose...

BTW, unless it's used a really free compiler, all comercial uses can't be made...maybe is yet just only then OpenBsp compiler (not ended , http://www.osmanturan.com/ ) , MAP3BSPC (not ended, seems abandoned http://sourceforge.net/projects/map3bspc/) , or getic3d, quite nice, totally free,( http://www.zalsoft.com/index.php ) and very complete (I'd certainly would give this thing a try if I wouldn't have already gile[s])
But surely is not quake3 BSP compliant (or maybe yes, who knows)

The other option free for comercial , is use the HL1 BSP, with the ZHLT compiling tools. ( http://collective.valve-erc.com/index.php?go=mhlt newer : http://www.zhlt.info/ http://hosted.filefront.com/amckern ) And use a really free editor for it like Quark. (Hammer and worldcraft qradiant, etc, arent) ... http://www.planetquake.com/quark/

As allways : BSP is mor elimited, though has some advantages...I still prefer a non bsp based workflow, being an artist.


"Regarding the my3d file format - would it be possible to use it with Gmax + for example Yafray renderer for render to texture. Being similar to 3dsmax maybe the export scripts would work too."

Murphy and I also spoke bout using the yafray XML exporters and all, via listener (and mouse trick) , as there was one even supporting multisubobject material of Gmax. Finally didn't go that way.


"And lastly are there free programs that can export lightmapped geometry to commercial formats like Cartography Shop .csm or maybe Deled .dmf ?"


I think among the tools, I have included some of the bunch that Murphy made: conversion among mim or oct to dmf and csm , I think. nothing else I know.


"Feel free to share any workflows that you have and only use free tools."

Only free workflows I know(they'r all doable, but some quite hard to guess all tricks ) :

- BSP (HL1 BSP with zhlt compiling tools; getic 3d level editor and bsp compiler, all for free, with code examples to load in ur game, one very nice way, surely Getic.nycodeo.com. Quake 3 bsp with the free compiler at sourceforge, or OpenBSP http://www.osmanturan.com . ) or Afecelis's way by using Gmax.

- FSRAD way(then use Blender(build scene, materials, lights(colors, intensity..))+FSRAD(Murphy's version) with the OCT format and irrlicht OCT loader. or the Trancos modified version+ his tools ) requires a bit hard trial and error and reading help of FSRAD. But if you dig in that long thread of lMurphy, you'll see some quick shots I made that it can end up working quite well.

-Trancos way. You can use non curved surfaces one and lmts loader he also made for Irrlicht. Or if have it, the latest alpha (I have it somewhere...) he made with normals support, I can't remember which problem was with that, Trancos had to made something, but can't remember which...

-Blender render to UV texture (there are a bunch of scripts, specially one or two, very recent ) With this and MIM format and OBJ2MIM, (using a good OBJ exporter(look in my signature) for Blender) you surely are able to do a nice GI-like render in Blender, use the baked to channel UV 1 TGA texture(s) , export that as an OBJ with it's UVs (OBJ+mtl+texture, allways put all in same folder, I indeed put EVERYTHING of a level project in same folder...) , and apart the exactly same OBJ mesh, but with the real textures. And the use the MIM stuff to cook it and mim loader in irrlicht. This way should provide good curved surfaces lightmaps: I just haven't tried....

-There was another one...Oh, yes...one very similar to Trancos one...Slimshady. Again, no curved surfaces supported, all is lightmapped as if it were faceted.

-And another, but too hard to handle to mention.
Finally making games again!
http://www.konekogames.com
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

Post by Iaro »

Many thanks for your reply vermeer. From the workflows you mentioned the Blender->obj->mim looks the most promising. I'll try and see if i can acomplish something.
About mim :
1. It's very good to know it can suport curved surfaces.
2. The problems I have ( this could possibly be a very stupid error ) :
In the quake3map example which just loads a 3d file besides the main.cpp I also added CMIrrMeshLoader.cpp and now get 35 errors. I also tried to add #include <CMIrrMeshLoader.h> in the beggining of main.cpp but I only get one more error.

some errors :

Code: Select all

 
   E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(70) : error C2440: 'initializing' : cannot convert from 'unsigned short [6]' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(70) : error C2440: 'initializing' : cannot convert from 'class irr::video::SColorf' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(71) : error C2440: 'initializing' : cannot convert from 'unsigned short [5]' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(71) : error C2440: 'initializing' : cannot convert from 'class irr::video::SColorf' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(72) : error C2440: 'initializing' : cannot convert from 'unsigned short [5]' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(72) : error C2440: 'initializing' : cannot convert from 'class irr::video::SColorf' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(73) : error C2440: 'initializing' : cannot convert from 'unsigned short [6]' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(73) : error C2440: 'initializing' : cannot convert from 'class irr::video::SColorf' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(74) : error C2440: 'initializing' : cannot convert from 'unsigned short [5]' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(74) : error C2440: 'initializing' : cannot convert from 'class irr::video::SColorf' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(75) : error C2440: 'initializing' : cannot convert from 'unsigned short [5]' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(75) : error C2440: 'initializing' : cannot convert from 'class irr::video::SColorf' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(76) : error C2440: 'initializing' : cannot convert from 'unsigned short [5]' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
E:\irrlicht-0.10.0\examples\02.Quake3Map\CMIrrMeshLoader.cpp(76) : error C2440: 'initializing' : cannot convert from 'class irr::video::SColorf' to 'struct irr::scene::CMIrrMeshLoader::ColorTable_t'
        No constructor could take the source type, or constructor overload resolution was ambiguous
   

About loading the mim : scene::IAnimatedMesh* mesh = smgr->getMesh("main.mim"); . Is this the correct way to do it?
grayman
Posts: 69
Joined: Thu May 12, 2005 10:48 am
Location: colombia

Post by grayman »

just ise .MY3D, its buggy in irrlicht 0.11.0 but i hope what it will be fixed soon, is a very good lightmap keeper format
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

Post by Iaro »

grayman - unfortunately I don't currently know a free workflow for using .my3d. But maybe that could change in the future, the format indeed looks very nice.

About Blender -> obj -> mim experiments:

1. In Blender I created a cube. Then in editmode -> new material, assigned a new image texture, back to material and changed the coordinates from orco to uv. Then I changed to uv face select mode, selected all the faces, from face menu -> unwrap uv -> cube. Then exported as default.obj .

2. In command line : obj2mim -f default.obj default.mim , thus obtaining the mim file. Now the problem : in simpleviewer.exe i keep getting this message : "Could not load mesh, file format seems to be unsupported : default.mim"
I tried using a bat file with : simpleviewer.exe -mimlights but I keep getting the same message.

Below is the default.mim file so maybe someone who is familiar with the format could say if it's ok :

Code: Select all

 <?xml version="1.0"?>
<MIrrlichtMesh>
 <meshBuffer>
  <material lighting="false" backfaceCulling="true" materialType="EMT_SOLID" textureFile1="testi.jpg" />
  <polygon>
   <vertex x="1.0" y="0.9999999" z="-1.0" nx="0.5773492" ny="0.5773492" nz="-0.5773492" u1="0.0" v1="0.0" />
   <vertex x="1.0" y="-1.0" z="-1.0" nx="0.5773492" ny="-0.5773492" nz="-0.5773492" u1="0.0" v1="-1.0" />
   <vertex x="-0.9999996" y="1.0" z="-1.0" nx="-0.5773492" ny="0.5773492" nz="-0.5773492" u1="-0.9999998" v1="0.0000002384186" />
  </polygon>
  <polygon>
   <vertex x="1.0" y="-1.0" z="-1.0" nx="0.5773492" ny="-0.5773492" nz="-0.5773492" u1="0.0" v1="-1.0" />
   <vertex x="-1.0" y="-0.9999998" z="-1.0" nx="-0.5773492" ny="-0.5773492" nz="-0.5773492" u1="-1.0" v1="-0.9999999" />
   <vertex x="-0.9999996" y="1.0" z="-1.0" nx="-0.5773492" ny="0.5773492" nz="-0.5773492" u1="-0.9999998" v1="0.0000002384186" />
  </polygon>
  <polygon>
   <vertex x="1.0" y="0.9999995" z="1.0" nx="0.5773492" ny="0.5773492" nz="0.5773492" u1="0.0000002384186" v1="0.9999998" />
   <vertex x="-0.9999999" y="1.0" z="1.0" nx="-0.5773492" ny="0.5773492" nz="0.5773492" u1="-1.0" v1="1.0" />
   <vertex x="0.9999993" y="-1.000001" z="1.0" nx="0.5773492" ny="-0.5773492" nz="0.5773492" u1="-0.0000003576279" v1="-0.0000002980232" />
  </polygon>
  <polygon>
   <vertex x="-0.9999999" y="1.0" z="1.0" nx="-0.5773492" ny="0.5773492" nz="0.5773492" u1="-1.0" v1="1.0" />
   <vertex x="-1.0" y="-0.9999996" z="1.0" nx="-0.5773492" ny="-0.5773492" nz="0.5773492" u1="-1.0" v1="0.0000001788139" />
   <vertex x="0.9999993" y="-1.000001" z="1.0" nx="0.5773492" ny="-0.5773492" nz="0.5773492" u1="-0.0000003576279" v1="-0.0000002980232" />
  </polygon>
  <polygon>
   <vertex x="1.0" y="0.9999999" z="-1.0" nx="0.5773492" ny="0.5773492" nz="-0.5773492" u1="0.0" v1="0.0" />
   <vertex x="1.0" y="0.9999995" z="1.0" nx="0.5773492" ny="0.5773492" nz="0.5773492" u1="-0.0000002384186" v1="1.0" />
   <vertex x="1.0" y="-1.0" z="-1.0" nx="0.5773492" ny="-0.5773492" nz="-0.5773492" u1="-1.0" v1="0.0" />
  </polygon>
  <polygon>
   <vertex x="1.0" y="0.9999995" z="1.0" nx="0.5773492" ny="0.5773492" nz="0.5773492" u1="-0.0000002384186" v1="1.0" />
   <vertex x="0.9999993" y="-1.000001" z="1.0" nx="0.5773492" ny="-0.5773492" nz="0.5773492" u1="-1.0" v1="1.0" />
   <vertex x="1.0" y="-1.0" z="-1.0" nx="0.5773492" ny="-0.5773492" nz="-0.5773492" u1="-1.0" v1="0.0" />
  </polygon>
  <polygon>
   <vertex x="1.0" y="-1.0" z="-1.0" nx="0.5773492" ny="-0.5773492" nz="-0.5773492" u1="0.0" v1="0.0" />
   <vertex x="0.9999993" y="-1.000001" z="1.0" nx="0.5773492" ny="-0.5773492" nz="0.5773492" u1="-0.0000003576279" v1="1.0" />
   <vertex x="-1.0" y="-0.9999998" z="-1.0" nx="-0.5773492" ny="-0.5773492" nz="-0.5773492" u1="-1.0" v1="0.0" />
  </polygon>
  <polygon>
   <vertex x="0.9999993" y="-1.000001" z="1.0" nx="0.5773492" ny="-0.5773492" nz="0.5773492" u1="-0.0000003576279" v1="1.0" />
   <vertex x="-1.0" y="-0.9999996" z="1.0" nx="-0.5773492" ny="-0.5773492" nz="0.5773492" u1="-1.0" v1="1.0" />
   <vertex x="-1.0" y="-0.9999998" z="-1.0" nx="-0.5773492" ny="-0.5773492" nz="-0.5773492" u1="-1.0" v1="0.0" />
  </polygon>
  <polygon>
   <vertex x="-1.0" y="-0.9999998" z="-1.0" nx="-0.5773492" ny="-0.5773492" nz="-0.5773492" u1="0.00000008940697" v1="0.0" />
   <vertex x="-1.0" y="-0.9999996" z="1.0" nx="-0.5773492" ny="-0.5773492" nz="0.5773492" u1="0.0000001788139" v1="1.0" />
   <vertex x="-0.9999996" y="1.0" z="-1.0" nx="-0.5773492" ny="0.5773492" nz="-0.5773492" u1="1.0" v1="0.0" />
  </polygon>
  <polygon>
   <vertex x="-1.0" y="-0.9999996" z="1.0" nx="-0.5773492" ny="-0.5773492" nz="0.5773492" u1="0.0000001788139" v1="1.0" />
   <vertex x="-0.9999999" y="1.0" z="1.0" nx="-0.5773492" ny="0.5773492" nz="0.5773492" u1="1.0" v1="1.0" />
   <vertex x="-0.9999996" y="1.0" z="-1.0" nx="-0.5773492" ny="0.5773492" nz="-0.5773492" u1="1.0" v1="0.0" />
  </polygon>
  <polygon>
   <vertex x="1.0" y="0.9999995" z="1.0" nx="0.5773492" ny="0.5773492" nz="0.5773492" u1="0.0000002384186" v1="0.0" />
   <vertex x="1.0" y="0.9999999" z="-1.0" nx="0.5773492" ny="0.5773492" nz="-0.5773492" u1="0.0" v1="-1.0" />
   <vertex x="-0.9999999" y="1.0" z="1.0" nx="-0.5773492" ny="0.5773492" nz="0.5773492" u1="-1.0" v1="0.0" />
  </polygon>
  <polygon>
   <vertex x="1.0" y="0.9999999" z="-1.0" nx="0.5773492" ny="0.5773492" nz="-0.5773492" u1="0.0" v1="-1.0" />
   <vertex x="-0.9999996" y="1.0" z="-1.0" nx="-0.5773492" ny="0.5773492" nz="-0.5773492" u1="-0.9999998" v1="-1.0" />
   <vertex x="-0.9999999" y="1.0" z="1.0" nx="-0.5773492" ny="0.5773492" nz="0.5773492" u1="-1.0" v1="0.0" />
  </polygon>
 </meshBuffer>
</MIrrlichtMesh>
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

Check that theway you'r loading in code the map is the correct...I am not a programmer, just an artist, so I don't know...could be that you are trying to use the quake3 BSP code for loading a MIM file? Because if so, surely being bsp quite restricted in many ways, the code may be finding unexpected things, but I have zero ideas, as those aren't my duties: coding.

Sure Murphy would be of great help here, but I doubt he's reading the forums. I used to test map levels in seconds, from OBjs, to direct irrlicht using his code (the viewers) Look in case there's some sample code i n the zips I uploaded, specially I suppose in the viewer which support mim format, as actually that's code to load mim in irrlicht. Use the MIM loader to load MIM format, is also in the zip file I uploaded.

BTW, I have nothing against MY3D, but that's basicly Max, and usually not free... ;)

About Blender -> obj -> mim experiments:

1. In Blender I created a cube. Then in editmode -> new material, assigned a new image texture, back to material and changed the coordinates from orco to uv.
good.

Then I changed to uv face select mode, selected all the faces, from face menu -> unwrap uv -> cube. Then exported as default.obj .
In UV/image window, you need to asign the image, if I remember well.

2. In command line : obj2mim -f default.obj default.mim , thus obtaining the mim file. Now the problem : in simpleviewer.exe i keep getting this message : "Could not load mesh, file format seems to be unsupported : default.mim"
Beware, all is pointing the fact you're using the old simpleviewer, not the one supporting MIM format. I included a zip with long name which actually says it support mim format .The othe rone only supports OCT.

I tested huge loads of times the mim workflow, as was betatesting each improve besides tweaking my own nice way with FSRAD. (but the blender way with OBJ2mim sounds to me now mor einteresting...)

And example that seems I still keep :
(for speed sake, i use just *.bat files , and usually the "MSDOS prompt here" Windows registry trick)

obj2mim -t . -vf2 -f sp.obj -lm sp_lmap.obj -s 100 output.mim

that's for mim tools (actually it has a lot of commands (all well documented in the zips) but that's an example, depends on how u want it)

For simpleviewer :

simpleviewer output.mim

Another example :

simpleviewer -gl -32 -800x600 output.mim


remember it depends on the version of simpleviewer. Same with mimtools, (it's mim tools as there are converters of dmf, csm, etc...murphy had made a much more advanced non DOS version, a real pitty I don't seem t obe able to find in my HDs, but maybe in my backup CDs...BTW, main funcionality kept the same.This versions are the ones I actually used very much problem free)

BTW, in the MIM fomrat that is output, u'll see is ascii (he told me several times that during development he prefered so for his own comfort, but that wouldn't be a prob for him make it binary. Is a kind of XML easy to understand file, which indeed I modfied for testing different lightmap mode , so to the point, I think these were the modes : EMT_LIGHTMAP
EMT_LIGHTMAP_ADD
EMT_LIGHTMAP_M2
EMT_LIGHTMAP_M4 )

I think usuall M2 (in other engines/packages, is multiply*2 ) worked very nicely. Being M4 a bit high contrast. Also could be lightmap (that'd be "1") enough, depends on the scene lighting, etc.

I tried using a bat file with : simpleviewer.exe -mimlights but I keep getting the same message.
My bet is you'r not using the latest SViewer supporting MIM.
besides, I really recommend reading the doc he did wrote, is essential...


Below is the default.mim file so maybe someone who is familiar with the format could say if it's ok :


Also:


remember...you need actually this , for the workflow you'r wanting to use with Blender+mimtools+mim loader, only (you'r avoiding fsrad, which probably will remove some hassle, besides, avoiding thenon curved surfaces lightmap generation.) :

- An OBJ with it's UVs and texture(s).

- An OBJ which...you need to *bake* the lighting some way (here's the key step) in Blender into the texture , using the only one UV slot available in Blender. The standard channel1 of allways. Actually, if u get this, ur done, and u can get reaaaally nice GI occlussion rendered lightmaps with Blender and MIM tools/format. Indeed, who knows, I may make a test at least of this very specific point, in case you get stuck. But only possibly.
There's a plugin I think made by JMS...but I am not sure if that one does not bake lighting...and another one that does, and very recently, someone has done one for baking radiosity , into vertex colors (using certain "button" in blender, vcol....well, the script seems nice) , and then translating that into an UV texture. So, you'd export then this OBJ, just asigning as texture the new tga(s) that actually are the baked lighting into an UV texture, which actually will be of b/w and greys...

MIM2OBJ will eat both putting well the command line I put u above (read the help txt ) and make a MIM file out of all of it. You still need the textures(oct put all inside the file, MIM doesn't put the textures, if I remember well, inside the file), and as allways, I try to keep all in same folder.

And u'd be done.

What is more, solved that blender step (the matter is...simply Blender is not prepared to do lightmaps, by no means: first as it doesn't have two UV channels, second, as it has not a polished way to bake the render into UV textures. )


I'll probably dig to get the link of the ideal plugin here for Blender to do that bake. And if I do so, most surely would do the test and post the files here.


BTW, dunno if I gave the correct file...the othe rday..is long time since last time I touched this...

well, I'm uploading now a viewer that does work for me...remember is often all about the parameters (gl used to work mor etimes for the viewer, I think)


Remember, inside the viewer, it's mouse for orientation, and cursor keys to actually move....

That's a reaaally crap bunch of boxes, not a level, that I used for all the tests :

http://www.sendmefile.com/00023136



Only will be 14 days there, like allways.

And it has the simpleviewer supporting MIM, a mim sample I made, a texture, and a lightmap tga. I think u can use tgas and jpg for texture and tga for lightmaps, not sure. I allways used jpg for texture, tga for lightmap.Just for I have it since beguining that way.


tried your file, and doesn't work, but...logically, as you did not provide the textures...you need actually a pair of textures, one the real texture, and another , the tga lightmap. keep all in same folder though it may look to you a bit disordered.
I'm gonna search later that Blender script and try and make some serious test of it with latest Blender.
Finally making games again!
http://www.konekogames.com
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

Post by Iaro »

Many thanks again, vermeer. Using the simpleviewer and irrlicht.dll you provided I was finally able to load a mim file ( a cube with a jpg as texture1 and a tga as texture2 ). here's a pic : http://img309.imageshack.us/img309/5862/cube9iw.jpg

I don't know if the mim format is limited to only two textures ( a normal one and the lightmap ) or can have different textures onto different polygons, but even if it is maybe it could be used to provide detail textures to terrain : Load the terrain texture into texture1 and the detail texture ( for example a simple noise image ) into texture2.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

probably is possible...

the fact is he also told me would be easy to add multitexturing for that...

Ehm, you can have in same UV channel(1) asigned several textures to different polygons, as all that info is written by 3d softwares in the *.mtl text file when you export as OBJ....Remember allways to put in same folder all, mtl, obj, textures, mim file ,etc. An OBj can be very complex in that, as much as you want.


I'm playing with blender and some scripts...I'll tell you later...
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

HEY....while I was seeking for that script I mentioned....

[ there are 2, one that could be doing already the light baking, and another that was an attempt but is at least quite complex and incomplete...]

Found out googling a bit that...hey! surely for the making of a much modern version, Awakening, Windsoft as made free his previous LMMAKER tool! Is this old news?? If so...how? I was at their site not that long ago...


But today I've seen clearly saying a big banner: LMMAKER is now free!


Lol, OBJ, b3d, ac3d, dxf, morfit terragen, 3ds support.....
radiosity or lightmap standard making....both posibilities....


Well did fly to download that latest version previous to Awakening, and...testing now!

tell u later....
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

this is working.

Yet not tested wel radiosity, but an standard lightmap in average aceptable uality is done in no time! I see much speed than in others.


Thi swould allow you or anyone to export as *.x file with a texture attached. Only thing is would need the freebie Metasequoia (for example) To set at least the autosmooth, that is, some vertex normals as I see this thing get a bit broken in export, nothing serious.


Also: important to scale the mesh while you work: later on you just scale down again, just write down the number you multiplied for. This makes way easier to handle the level.


It has the main 3 lights types, point, directional, omni.
is working quite well, and I saw already how to tweak settings to increase quality.

That is: provided you have available a Windows, or if wine works with this, you have then now already a free workflow, freaking easier than all we were talking about. And unless I'm wrong, once I get the nice settings and tricks and paste here, of quite enough quality.

You'd only need the step of converting the mesh to OBj and applying an autosmooth to fix a bit the normals.

There are several tools that can help in the way: Lithunwrap, Metasequoia, Anim8or, Accutrans, 3dExploration 1.5 (maybe this one the better) ,etc.

Is a simple conversion to OBJ (LMM 0.36 exports as 3ds, b3d, ascii txt, vrml 97, *.x ) Normals fix (just set an autosmooth) I'd go for x or the ascii. And then use OBJ2MIM, load the MIM file. I may make later or tomorrow a quick export so to show you the MIM viewer (that is, irrlicht 0.7) screenshots...i used the ugly sample I made long ago ;)
Finally making games again!
http://www.konekogames.com
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

Post by Iaro »

Absolutely INCREDIBLE find vermeer.
For some reason though their site loads veeery slow ( and other sites load fine ). The program although quite small literally took hours to download but is was well worth the wait. I tried exporting some example scenes to .x and it generated a beautifull lightmap quite similar to the one you provided.
Maybe I haven't seen many lightmapped scenes but for example the shiningroom one seemed very close to reality.

Again great fine, and many thanks.
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

Any possibility someone could post LMM to an alternate download site, I can't get this thing to download at all. If you are up for it, I could PM an email address if you would be so kind.
Iaro
Posts: 45
Joined: Sat Feb 05, 2005 7:01 am

Post by Iaro »

dhenton9000 - I don't know windssoft's policy regarding distribution, but being freeware I don't think there would be any problem. If you want you can PM me. Indeed when I tried to download it using the normal downloader Internet explorer has, it downloaded a little bit and then froze, so i had to resort to an internet download manager , pausing and restarting it ocassionally.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

I downloaded it, I really doubt there's a prob in distributing: no register form, no nothing...

I downloaded both install and rar only versions, been running the no-install one, quite fine....
Finally making games again!
http://www.konekogames.com
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

thanks so much, but i finally got it to download!!

Now my question is, what to do with it? Do I understand light maps correctly when I say that I now have to write something like the OCT loader which combines the light maps and textures maps via a SLightMapMesh?
Post Reply