Results 1 to 9 of 9

Thread: light map maker

  1. #1

    light map maker

    hi

    is there a good Light map maker tool , that import 3ds file format

    i've found awingsoft's light map maker , its good program and provide an SDK suport , but because i am not familier with c++ and plugins , i could not write my own plugin

    also there is LMTS maker of lord trancos , but this one dosn't do a good job especially
    the casting shadows isn't really good .

    the last one is Lightmapper of Nitrogen , as the author of this tool said that this program is only for educational purpose only ( thats good ) but the fact is its very slow .

    thanks in advance



  2. #2

    Re: light map maker

    AFAIK, you can use DeleD for that purpose. It imports 3DS files and produces lightmaps. It's open source, so no need to worry about anything.

  3. #3
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Re: light map maker

    Dunno, but you can write your own. It's not that hard to do.
    I did it a while back for use in my old engine. It was slow dough...
    But I think you can optimize it pretty easy with the use of an physics engine
    NecroSOFT - End of line -

  4. #4

    Re: light map maker

    thanks for replys , but i don't think that i can write my own right now (seems hard)

    i finished my spline editor and all i want to do is lightmapping my world then the rest will be easy

  5. #5

    Re: light map maker

    The best/powerfull lightmapper i have seen is called Giles, used to be comercial but now it is free!!,

    http://www.frecle.net/index.php?show...ub=screenshots

  6. #6

    Re: light map maker

    Wow, this one really seems to be rocking! Downloaded and bunkered it just in case the site goes down (like it was with FontStudio).

  7. #7

    Re: light map maker

    very nice , but how could we read the file format
    do you know some (delphi) loader for that ?

  8. #8

    Re: light map maker

    You can try making your own. The specification is available from their website: http://www.frecle.net/download/glsspecs.htm

    I did a quick search and found this one. It's written in C++. I didn't take a deeper look, but maybe it won't be that much hassle to convert it to Pascal.

    EDIT
    It shouldn't be too hard to convert it. I started it, but was a little busy to study the specs in detail. I didn't test the code, but it compiles under D2010. Here's what I've got so far:
    [code=delphi]
    type
    { .: TGiles :. }
    TGiles = class sealed(TObject)
    strict private
    { Strict private declarations }
    type
    { .: TGLSChunk :. }
    TGLSChunk = record
    ID: Integer;
    Size: Integer;
    end;

    { .: TGLSHeader :. }
    TGLSHeader = record
    S: AnsiString;
    Version: Single;
    end;

    { .: TGLSAuthor :. }
    TGLSAuthor = record
    S: AnsiString;
    end;

    { .: TGLSLightmap :. }
    TGLSLightmap = record
    Name: AnsiString;
    FileName: AnsiString;
    Width: Word;
    Height: Word;
    NonUniform: Boolean;
    UseCustomTexels: Boolean;
    CustomTexelSize: Single;
    Repack: Boolean;
    Data: array of Byte;
    end;

    { .: TGLSTexture :. }
    TGLSTexture = record
    FileName: AnsiString;
    ScaleU: Single;
    ScaleV: Single;
    OffsetU: Single;
    OffsetV: Single;
    Angle: Single;
    Flags: Integer;
    Blend: Integer;
    CoordSet: Byte;
    end;
    private
    { Private declarations }
    Data: array of Byte;
    Offset: DWORD;
    FileSize: Integer;
    FFileAuthor: AnsiString;

    procedure ReadHeader(Header: TGLSHeader);
    procedure ReadHeaderSubChunks();
    procedure ReadAuthorChunk();
    procedure ReadModelsChunk();
    procedure ReadModelData();

    function ReadString(): AnsiString;
    function ReadFloat(): Single;
    function ReadChunk(): TGLSChunk;
    public
    { Public declarations }
    constructor Create(const AFileName: String);

    property FileAuthor: AnsiString read FFileAuthor;
    end;

    { TGiles }

    constructor TGiles.Create(const AFileName: String);
    var
    FS: TFileStream;
    Header: TGLSHeader;
    begin
    inherited Create();

    FS := TFileStream.Create(AFileName, fmOpenRead);
    try
    Offset := 0;
    FileSize := FS.Size;

    SetLength(Data, FileSize);
    FS.Read(Data[0], FileSize);
    finally
    FS.Free();
    end;

    ReadHeader(Header);
    end;

    procedure TGiles.ReadAuthorChunk;
    begin
    FFileAuthor := ReadString();
    end;

    function TGiles.ReadChunk: TGLSChunk;
    begin
    CopyMemory(@Result, @Data[Offset], SizeOf(TGLSChunk));
    Offset := Offset + SizeOf(TGLSChunk);
    end;

    function TGiles.ReadFloat: Single;
    begin
    Result := 0.0;

    CopyMemory(@Result, @Data[Offset], SizeOf(Single));
    Offset := Offset + SizeOf(Single);
    end;

    procedure TGiles.ReadHeader(Header: TGLSHeader);
    var
    Chunk: TGLSChunk;
    begin
    Chunk := ReadChunk();

    if (Chunk.ID = $FFFF) then
    begin
    Header.S := ReadString();
    Header.Version := ReadFloat();
    end;
    end;

    procedure TGiles.ReadHeaderSubChunks;
    var
    Chunk: TGLSChunk;
    begin
    while True do
    begin
    Chunk := ReadChunk();

    case Chunk.ID of
    $F000:
    ReadAuthorChunk();
    $1000:
    ReadModelsChunk();
    end;
    end;
    end;

    procedure TGiles.ReadModelData;
    begin

    end;

    procedure TGiles.ReadModelsChunk;
    var
    Chunk: TGLSChunk;
    begin
    while True do
    begin
    Chunk := ReadChunk();

    if (Chunk.ID = $1001) then
    ReadModelData()
    else
    begin
    Offset := Offset - SizeOf(TGLSChunk);
    break;
    end;
    end;
    end;

    function TGiles.ReadString: AnsiString;
    var
    StrLength, StrOffset: Integer;
    C: AnsiChar;
    begin
    Result := '';
    StrLength := 0;
    StrOffset := Offset;
    C := #0;

    while True do
    begin
    C := AnsiChar(Data[StrOffset]);
    Inc(StrOffset);
    Inc(StrLength);

    if (C = #0) then
    break;
    end;

    SetLength(Result, StrLength);
    CopyMemory(@Result[1], @Data[Offset], StrLength * SizeOf(AnsiChar));
    Offset := Offset + (SizeOf(AnsiChar) * StrLength);
    end;
    [/code]
    Hopefully you can expand it and use it in your work.

  9. #9

    Re: light map maker

    There are some paths you can fallow to put/get your geometry with others 3d tools, use intermediary supported file format, write your own native file reader/writer, or write your plugin for your own file format.

    If you current dosent have any well know 3d file format exporter for your pipeline then you should consider doing one if you pretend to use free 3d tools out there for your pipeline production; one you have at least one file format support then you can use some free 3d file converter

    Giles allow to import/export the geometry from some popular files like 3ds,directx *.x files, Obj, LWO, b3d.

    The files native file format is al documented so you can try to code a raeder/writer for it.

    Giles also support building DLL plugins (which you can do it with delphi), for build importer/exporter for your own file format, i have seen the pluging sdk documents and it looks very simple, just few functions that pass/get a pointe to block memory with data from the program to be parsed.

    Me personally think i will use the b3d (blitz3d) intermediary file format path, it support to import/export all necessary data to giles and it is well popular for been used to communicate (directly or indirectly using a converter) for other tools out there. IF you get GLSCENE source code, ypu can found there an unit to read b3d files.

    BTW, i sugest to download also Giles 1.36 verson, curent 2.0 beta crash to often in my computer.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •