News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - vurt

#1
Found a cheap copy of the original Doom3, the textures are easily accessable there. I do belive the textures must have been upgraded somewhat for BFG though, because in the original game they are super low res (yes even more so it seems). I'm not into coding, im into doing textures and 3D modelling. Thanks though.

Oculus Rift sparked new interest, the game is really something else in VR.. great implementation for a mod too. https://github.com/KozGit/DOOM-3-BFG-VR/releases/tag/v0.015-Alpha
#2
Quote from: trebor on April 24, 2015, 05:57:32 AM
You can extract all images back to .png in void idImage::ActuallyLoadImage( bool fromBackEnd )
by adding

if( image_exportPNG.GetBool() && binaryFileTime != FILE_NOT_FOUND_TIMESTAMP )
   {
      const bimageImage_t& img = im.GetImageHeader( 0 );
      
      const byte* data = im.GetImageData( 0 );
      
      //( img.level, 0, 0, img.destZ, img.width, img.height, data );
      
      idTempArray<byte> rgba( img.width * img.height * 4 );
      memset( rgba.Ptr(), 255, rgba.Size() );
      
      if( header.format == FMT_DXT1 )
      {
         idDxtDecoder dxt;
         dxt.DecompressImageDXT1( data, rgba.Ptr(), img.width, img.height );
         
         if( header.colorFormat == CFM_GREEN_ALPHA )
         {
            byte* pic = rgba.Ptr();
            for( int i = 0; i < img.width * img.height; i++ )
            {
               pic[i * 4 + 3] = pic[i * 4 + 1];
               pic[i * 4 + 0] = 255;
               pic[i * 4 + 1] = 255;
               pic[i * 4 + 2] = 255;
            }
         }
      }
      else if( header.format == FMT_DXT5 )
      {
         idDxtDecoder dxt;
         
         if( header.colorFormat == CFM_NORMAL_DXT5 )
         {
            dxt.DecompressNormalMapDXT5( data, rgba.Ptr(), img.width, img.height );
         }
         else if( header.colorFormat == CFM_YCOCG_DXT5 )
         {
            dxt.DecompressYCoCgDXT5( data, rgba.Ptr(), img.width, img.height );
         }
         else
         {
         
            dxt.DecompressImageDXT5( data, rgba.Ptr(), img.width, img.height );
         }
      }
      else if( header.format == FMT_LUM8 || header.format == FMT_INT8 )
      {
         // LUM8 and INT8 just read the red channel
         byte* pic = rgba.Ptr();
         for( int i = 0; i < img.dataSize; i++ )
         {
            pic[ i * 4 ] = data[ i ];
         }
      }
      else if( header.format == FMT_ALPHA )
      {
         // ALPHA reads the alpha channel
         byte* pic = rgba.Ptr();
         for( int i = 0; i < img.dataSize; i++ )
         {
            pic[ i * 4 + 3 ] = data[ i ];
         }
      }
      else if( header.format == FMT_L8A8 )
      {
         // L8A8 reads the alpha and red channels
         byte* pic = rgba.Ptr();
         for( int i = 0; i < img.dataSize / 2; i++ )
         {
            pic[ i * 4 + 0 ] = data[ i * 2 + 0 ];
            pic[ i * 4 + 3 ] = data[ i * 2 + 1 ];
         }
      }
      else if( header.format == FMT_RGB565 )
      {
         // FIXME
         /*
         byte* pic = rgba.Ptr();
         for( int i = 0; i < img.dataSize / 2; i++ )
         {
            unsigned short color = ( ( pic[ i * 4 + 0 ] >> 3 ) << 11 ) | ( ( pic[ i * 4 + 1 ] >> 2 ) << 5 ) | ( pic[ i * 4 + 2 ] >> 3 );
            img.data[ i * 2 + 0 ] = ( color >> 8 ) & 0xFF;
            img.data[ i * 2 + 1 ] = color & 0xFF;
         }
         */
      }
      else
      {
         byte* pic = rgba.Ptr();
         for( int i = 0; i < img.dataSize; i++ )
         {
            pic[ i ] = data[ i ];
         }
      }
      
      idStr pngFileNameExport = generatedName;
      pngFileNameExport.SetFileExtension( ".png" );
      
      R_WritePNG( pngFileNameExport, rgba.Ptr(), 4, img.width, img.height, true, "fs_basepath" );
   }

Sorry for resurrecting this old post.. Does anyone know how / where I would i apply this script?

I'd like to make a texture pack for Doom 3 BFG, being able to see and open the generated .bimage files is vital. Haven't found any converters.

Thanks