Game Development Community

Light Maps

by Anthony Rosenbaum · in Torque Game Engine · 01/03/2005 (12:55 pm) · 1 replies

How can I view the image of the lightmap?

#1
01/03/2005 (5:58 pm)
I added the following code to map2dif in EditInteriorRes.cpp:

void EditInteriorResource::dumpLightmaps( const char* OutPath )
{
	if ( mDetailLevels.size() < 1 || !mDetailLevels[0] ) {
		return;
	}

	Interior* Detail = mDetailLevels[0];

	U32 minCnt = 0;
    for(U32 j = 0; j < Detail->mLightmaps.size(); j++)
    {
        if( Detail->mLightmaps[j] )
        {
	FileStream output;
	output.open( avar("%s\lightmap_%d.png", OutPath, minCnt++), FileStream::Write );
	Detail->mLightmaps[j]->writePNG( output );
        }
    }
}

You just need to call this code somewhere near the end of main before gWorkingResource gets deleted.

I did this in the TSE version of map2dif, but i think it should work for TGE too.