mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-21 17:20:46 +00:00
Fixed PBR _rmao lookup hack on the wrong textures. Close #905
This commit is contained in:
parent
504e7f5591
commit
c226650c0c
3 changed files with 24 additions and 7 deletions
|
@ -1035,12 +1035,16 @@ void R_LoadImage( const char* cname, byte** pic, int* width, int* height, ID_TIM
|
|||
if( name.StripTrailingOnce( "_s" ) )
|
||||
{
|
||||
name += "_rmao";
|
||||
|
||||
ext = "png";
|
||||
name.DefaultFileExtension( ".png" );
|
||||
|
||||
pbrImageLookup = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
name = origName;
|
||||
}
|
||||
|
||||
ext = "png";
|
||||
name.DefaultFileExtension( ".png" );
|
||||
|
||||
pbrImageLookup = true;
|
||||
}
|
||||
#if 0
|
||||
else if( usage && *usage == TD_R11G11B10F )
|
||||
|
|
|
@ -390,9 +390,12 @@ void idImage::FinalizeImage( bool fromBackEnd, nvrhi::ICommandList* commandList
|
|||
// RB: PBR HACK - RMAO maps should end with _rmao insted of _s
|
||||
if( usage == TD_SPECULAR_PBR_RMAO )
|
||||
{
|
||||
if( imgName.StripTrailingOnce( "_s" ) )
|
||||
idStr baseName = imgName;
|
||||
baseName.StripFileExtension();
|
||||
|
||||
if( baseName.StripTrailingOnce( "_s" ) )
|
||||
{
|
||||
imgName += "_rmao";
|
||||
imgName = baseName + "_rmao";
|
||||
}
|
||||
}
|
||||
// RB end
|
||||
|
|
|
@ -134,6 +134,16 @@ idImage::idImage( const char* name ) : imgName( name )
|
|||
binaryFileTime = FILE_NOT_FOUND_TIMESTAMP;
|
||||
refCount = 0;
|
||||
|
||||
#if 0
|
||||
// debugging code
|
||||
idStr ext;
|
||||
imgName.ExtractFileExtension( ext );
|
||||
if( ext.Length() > 0 )
|
||||
{
|
||||
common->Printf( "Image %s has extension\n", imgName.c_str() );
|
||||
}
|
||||
#endif
|
||||
|
||||
DeferredLoadImage();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue