Visualizing rendered mip level

Many years ago, there was a feature that colorized each mip level on upload so it was easy to see which mip levels were being rendered. Magenta for level 0, cyan for 1, yellow for 2 etc.

I don’t see anything like that now; is there a new way to visualize the rendered mip level?

Cheers
John

I’m looking for this as well, did you ever find it?

No - I hacked in an ugly solution with a compile option in 4.8. Here are the changes, but YMMV in later versions

In Texture2D.cpp

	#if !WITH_EDITORONLY_DATA
		// on console we don't want onload conversions
		checkf(EffectiveSize == (uint32)MipMap.BulkData.GetBulkDataSize(), 
			TEXT("Texture '%s', mip %d, has a BulkDataSize [%d] that doesn't match calculated size [%d]. Texture size %dx%d, format %d"),
			*Owner->GetPathName(), MipIndex, MipMap.BulkData.GetBulkDataSize(), EffectiveSize, Owner->GetSizeX(), Owner->GetSizeY(), (int32)Owner->GetPixelFormat());
	#endif

#if PSS_DEBUG
		if( PixelFormat == PF_DXT1 )
		{
			uint32 MipHackery = ( MipIndex << 16 ) | ( uint32 )PixelFormat;
			PixelFormat = ( EPixelFormat )MipHackery;
		}
#endif

…and RenderUtils.cpp

#if PSS_DEBUG
void ColorMips( uint8* Dest, uint32 Size, int32 MipIndex )
{
	static const uint16 MipColors[MAX_TEXTURE_MIP_COUNT][4] =
	{
		{ 0xf81f, 0xf81f, 0, 0 },
		{ 0xffe0, 0xffe0, 0, 0 },
		{ 0x07ff, 0x07ff, 0, 0 },

		{ 0xf800, 0xf800, 0, 0 },
		{ 0x07e0, 0x07e0, 0, 0 },
		{ 0x001f, 0x001f, 0, 0 },

		{ 0xf81f, 0xf81f, 0, 0 },
		{ 0xffe0, 0xffe0, 0, 0 },
		{ 0x07ff, 0x07ff, 0, 0 },

		{ 0xf800, 0xf800, 0, 0 },
		{ 0x07e0, 0x07e0, 0, 0 },
		{ 0x001f, 0x001f, 0, 0 },

		{ 0xf81f, 0xf81f, 0, 0 },
		{ 0xffe0, 0xffe0, 0, 0 },
	};

	int32 BlockCount = Size / 8;
	for( int32 Position = 0; Position < BlockCount; Position++, Dest += 8 )
	{
		FMemory::Memcpy( Dest, MipColors[MipIndex], 8 );
	}
}
#endif

void CopyTextureData2D(const void* Source,void* Dest,uint32 SizeY,EPixelFormat Format,uint32 SourceStride,uint32 DestStride)
{
#if PSS_DEBUG
	if( ( ( ( uint32 )Format ) & 0xffff ) == ( uint32 )PF_DXT1 )
	{
		ColorMips( ( uint8* )Dest, ( ( SizeY + 3 ) / 4 ) * SourceStride, Format >> 16 );
		return;
	}
#endif

Since 4.15 you can now use the command stat streaming to look at the mips budget.

This is maybe best used when putting your static mesh in a simple scene and zoom in and out to get and idea about how much mb is saved.

Here is the documentation for it: