LMTSFileLoader (lightmaps in Irrlicht)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

LMTSFileLoader (lightmaps in Irrlicht)

Post by jox »

Here is the LMTS file loader that I wrote and that where also discussed in this thread:

free compiler with lightmaps?
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3198

(you can find 2 screenshot there also)

It's the first free alternative to BSP!

It can load meshes with lightmaps that were created using Pulsar LMTools by Lord Trancos ( http://www.geocities.com/dxlab/index_en.html ).

-> DOWNLOAD IT HERE!

Instructions can be found in CLMTSMeshFileLoader.cpp.

Please reply here if you have any problems (or success :) )!
Last edited by jox on Mon Aug 16, 2004 10:11 am, edited 1 time in total.
nitroman

Post by nitroman »

THANKS JOX!

I have downloaded it, and it look great! I will try to add it to my project tomorrow (now I need to sleep, it's midnight)

it's fun to see that there is a result. And it will be very useful for all the Irrlicht community!
At least one alternative to proprietary BSP and q3map! :D YES!

can you provide a test map with a lightmap so I can test it more easily?

anyway thanks a lot for your great job!
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

grrrreat... :)
Finally making games again!
http://www.konekogames.com
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

Are lightmaps faster than dynamic light in Irrlicht? Not real time rendered I think....
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Fussel
Posts: 22
Joined: Fri Apr 09, 2004 1:47 pm

Post by Fussel »

yep they are faster, because the lightmaps are precalculated with an external tool, and this tool puts out the textuers with the lightinformation, then the normal texture and the lightmap are put together and the result is looking like there is a real light, but this only works for static lights of course. dynamic lights cant be precalculated, cause they are..guess what..dynamic*g*..so if you use lightmaps for all your lights that wont change in the level its a lot faster than using dozens of dynamic lights, even if they wont move.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

yes. Is just an overlayed bitmap for the engine.
Like a texture. Only that asigned to a second UV channel.

It can "look" as very high quality, as indeed, was generated rendering in the 3d pacakge with radiosity and all that, maybe during 20 mins...or more...(that's not realtime, for only one screen ;) )

It's a faked solution, perfect fo rstatic geometry. For characters, is no good. For characters is used dinamic lighting. But only for very well optimized and modern engines.

Dinmaic shadows is othe things. Is more frequent to find not self shadowing characters (dinamic shadows and lighting over the character) , but yest dinamic shadows in the floor, produced by the charcter, deopending on light source and how the character moves.

BSPs have lightmaps , since quake2 and older, so, is surely very low in performance waste.
Finally making games again!
http://www.konekogames.com
UrPc
Posts: 4
Joined: Fri Jan 16, 2004 7:23 pm

Post by UrPc »

That's exactly that what i need but there are some problems:

In LMDx (Form lmb11) my Level looks like this:

Image

And if i load it into Irrlicht it looks like this:

Image

The examle map from the DXLab website does also not load. And the working directory has to be set to the dir where the images are.
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

@UrPc: Thanx for your report!

Well, I can load the examle map from the DXLab! Unfortunately it has the same problem as yours...:

Image

Somehow the lightmap coordinates are messed up... I'll take a look at it!

Concerning the image path: You're right, that's no good... I just added a setTexturePath() function to my loader. With this you can point the loader to the textures! I will release it later tonight. Maybe I can fix the other problem too...

@nitroman: You can use this as a test map:

http://www.geocities.com/dxlab/zips/lmt ... plemap.zip
Fussel
Posts: 22
Joined: Fri Apr 09, 2004 1:47 pm

Post by Fussel »

@vermeer: carefull with "bsp´s have lightmaps"... a few of the formats that use bsp (like the quake ones) have lightmap-information included, but this is not always given...bsp is a technique to sort the geometry-data for indoor levels, there are not always lightmaps included.
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

There you go:

Image

8)

Forgot to mention something: Irrlicht doesn't like the lightmap tga's that LMTools generate (*.LM?????.tga)! I dunno if the problem is the tga's or the tga loader of Irrlicht. But If I open and resave them in photoshop then everything is fine!

I'll release version 1.1 of the loader in a minute (featuring the setTexturePath() function)...
Last edited by jox on Thu Jul 29, 2004 10:58 pm, edited 1 time in total.
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Version 1.1 of the CLMTSMeshFileLoader:

-> DOWNLOAD NOW!

Includes the new function ( setTexturePath() ) and mentions the TGA problem in the description (plus some minor improvement).
nitroman

Post by nitroman »

thanks a lot!
I have downloaded it and tested it... IT WORKS!
:D
for the tga files, I don't have photoshop but resaved them with Irfanview (it's a free and very powerful batch image converter).
it worked perfectly. 8)

for the compilation of CLMTSMeshFileLoader.cpp I got some problems...
I'm using MinGW (and dev-cpp as an IDE) for compilation and it didn't worked the first time I tried to compile.
It complained that "os.h" was not found...
I suppose that you use visualc++, but os.h is not included with mingw by default.
and after a search on google I didn't find the file...
I also got errors because mingw didn't know what is "cerr" ...

anyway, I solved the problem. :D
I deleted that line and changed all the includes to:

#include <string.h>
#include <SMeshBufferLightMap.h>
#include <SAnimatedMesh.h>
#include <SMeshBuffer.h>
#include <irrString.h>
#include <iostream>
#include <stdio.h>
#include "CLMTSMeshFileLoader.h"
using namespace std;

Now it works perfectly! :P

Does I miss something by replacing os.h by iostream?

Does my comment help you?

Again, Thanks for your great work! :D
nitroman

Post by nitroman »

I deleted that line
the line I deleted is :

#include <os.h>
nitromann

Post by nitromann »

also, I wanted to know if it is possible to replace the tga texture by jpeg ones (so it would take less size if I want people to download my game...)
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Thanx nitroman! I'm glad it works somehow now!

Yea os.h, it's part of Irrlicht. But it's not in the include dir, so it's not found... But it's neither needed so the line can be deleted! (it was for the log writer).

JPG should be possible. You just have to hack the *.lmts file and change the extension from tga to jpg I guess.
Post Reply