TrackTexture
TrackTexture
#Overview
name: TrackTexture
This variable is created as a Console Variable (cvar).
- type:
Exec
- help:
Sorry: Exec commands have no help
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of TrackTexture is to enable tracking of a specific texture within Unreal Engine’s content streaming system. This functionality is part of the engine’s asset management and streaming subsystem, which is responsible for efficiently loading and unloading textures and other render assets based on their usage and visibility in the game world.
The TrackTexture function is primarily used in the Engine module, specifically within the content streaming subsystem. It’s implemented in the ContentStreaming.cpp file and is also referenced in the StreamingManagerTexture.cpp file, which is part of the texture streaming management system.
The value of this variable (which is actually a function name) is not set directly, but rather it’s a function that is called to initiate the tracking of a texture. The function takes a texture name as a string parameter and returns a boolean indicating whether the tracking was successful.
TrackTexture interacts closely with TrackRenderAsset, which appears to be a more general version of the function that can handle various types of render assets, not just textures. In the implementation, TrackTexture simply calls TrackRenderAsset with the provided texture name.
Developers should be aware that this function is part of a larger system for managing streaming assets. It’s important to use this function judiciously, as tracking too many textures could potentially impact performance or memory usage.
Best practices when using this variable (function) include:
- Only track textures that genuinely need special streaming behavior.
- Ensure that textures being tracked are properly named and exist in the project.
- Use in conjunction with UntrackTexture when the texture no longer needs to be tracked.
- Be aware of the performance implications of tracking many textures.
- Consider using the more general TrackRenderAsset function if dealing with various types of streaming assets.
Additionally, developers should note that this function can be called via console commands, which can be useful for debugging or runtime adjustments to texture streaming behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:170
Scope (from outer to inner):
file
function bool TrackTexture
Source code excerpt:
}
bool TrackTexture(const FString& TextureName)
{
return TrackRenderAsset(TextureName);
}
/**
* Removes a texture/mesh name from being tracked in the streaming system and updates the .ini setting.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:331
Scope (from outer to inner):
file
function bool TrackTexture
Source code excerpt:
return false;
}
bool TrackTexture( const FString& TextureName )
{
return TrackRenderAsset(TextureName);
}
bool UntrackRenderAsset(const FString& AssetName)
{
return false;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:2933
Scope (from outer to inner):
file
function bool FRenderAssetStreamingManager::Exec
Source code excerpt:
return HandleNumStreamedMipsCommand( Cmd, Ar );
}
else if (FParse::Command(&Cmd,TEXT("TrackTexture"))
|| FParse::Command(&Cmd, TEXT("TrackRenderAsset")))
{
return HandleTrackRenderAssetCommand( Cmd, Ar );
}
else if (FParse::Command(&Cmd,TEXT("ListTrackedTextures"))
|| FParse::Command(&Cmd, TEXT("ListTrackedRenderAssets")))