[Gtkradiant] BSP monitoring from standard output?

ydnar gtkradiant@zerowing.idsoftware.com
Tue, 17 Feb 2004 13:02:03 -0800


This is a multi-part message in MIME format.
--------------020109040601070002080400
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I mean in the drawsurface struct. The code you list loads a lightmap 
just fine, though the brightening is something you might want to disable 
if you're generating your own levels. Q3Map2 has -gamma N.N control for 
proper light correction in floating-point without having to resort to 
lightmap scaling.

The only real specs are the Q3Map2 source code, which you can examine here:

https://zerowing.idsoftware.com:666/radiant/GtkRadiant/trunk/tools/quake3/q3map2/

See the bspfile_* files.

y


Riku 'Rakkis' Nurminen wrote:

>>OTOH, is OGRE reading the lightmap width/height offset?
>>    
>>
>
>Hrm, as far as I can see they are just assuming each lightmap is 128 *
>128 * 3 (ie. width, then hight, ..), as you can see in the DataChunk
>call here:
>
>    void Quake3Level::extractLightmaps(void) const
>    {
>        // Lightmaps are always 128x128x24 (RGB)
>        unsigned char* pLightmap = mLightmaps;
>        for (int i = 0; i < mNumLightmaps; ++i)
>        {
>            char name[32];
>            sprintf(name, "@lightmap%d", i);
>
>            // Load, no mipmaps, brighten by factor 2.5
>            Image img; img.loadRawData( DataChunk( pLightmap, 128 * 128
>* 3 ), 128, 128, PF_R8G8B8 );
>            TextureManager::getSingleton().loadImage( name, img,
>TEX_TYPE_2D, 0, 4.0f );
>            pLightmap += BSP_LIGHTMAP_BANKSIZE;
>        }
>    }
>
>Could this be the problem? It works for q3map maps..
>
>Btw, are there any "official" specs for the BSP format that comes from
>q3map2? Furthermore, is there any example code that was written
>especially for loading q3map2 maps? Could be better if I could see
>either of those instead of guessing the problems here..
>
>        - Riku
>
>_______________________________________________
>Gtkradiant mailing list
>Gtkradiant@zerowing.idsoftware.com
>http://zerowing.idsoftware.com/mailman/listinfo/gtkradiant
>
>
>  
>

--------------020109040601070002080400
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body>
I mean in the drawsurface struct. The code you list loads a lightmap
just fine, though the brightening is something you might want to
disable if you're generating your own levels. Q3Map2 has -gamma N.N
control for proper light correction in floating-point without having to
resort to lightmap scaling.<br>
<br>
The only real specs are the Q3Map2 source code, which you can examine
here:<br>
<br>
<a class="moz-txt-link-freetext" href="https://zerowing.idsoftware.com:666/radiant/GtkRadiant/trunk/tools/quake3/q3map2/">https://zerowing.idsoftware.com:666/radiant/GtkRadiant/trunk/tools/quake3/q3map2/</a><br>
<br>
See the bspfile_* files.<br>
<br>
y<br>
<br>
<br>
Riku 'Rakkis' Nurminen wrote:<br>
<blockquote cite="mid20040217083952.GA22150@equnet.org" type="cite">
  <blockquote type="cite">
    <pre wrap="">OTOH, is OGRE reading the lightmap width/height offset?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Hrm, as far as I can see they are just assuming each lightmap is 128 *
128 * 3 (ie. width, then hight, ..), as you can see in the DataChunk
call here:

    void Quake3Level::extractLightmaps(void) const
    {
        // Lightmaps are always 128x128x24 (RGB)
        unsigned char* pLightmap = mLightmaps;
        for (int i = 0; i &lt; mNumLightmaps; ++i)
        {
            char name[32];
            sprintf(name, "@lightmap%d", i);

            // Load, no mipmaps, brighten by factor 2.5
            Image img; img.loadRawData( DataChunk( pLightmap, 128 * 128
* 3 ), 128, 128, PF_R8G8B8 );
            TextureManager::getSingleton().loadImage( name, img,
TEX_TYPE_2D, 0, 4.0f );
            pLightmap += BSP_LIGHTMAP_BANKSIZE;
        }
    }

Could this be the problem? It works for q3map maps..

Btw, are there any "official" specs for the BSP format that comes from
q3map2? Furthermore, is there any example code that was written
especially for loading q3map2 maps? Could be better if I could see
either of those instead of guessing the problems here..

        - Riku

_______________________________________________
Gtkradiant mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gtkradiant@zerowing.idsoftware.com">Gtkradiant@zerowing.idsoftware.com</a>
<a class="moz-txt-link-freetext" href="http://zerowing.idsoftware.com/mailman/listinfo/gtkradiant">http://zerowing.idsoftware.com/mailman/listinfo/gtkradiant</a>


  </pre>
</blockquote>
</body>
</html>

--------------020109040601070002080400--