Navigation
API > API/Plugins > API/Plugins/ModelingComponents > API/Plugins/ModelingComponents/AssetUtils > API/Plugins/ModelingComponents/AssetUtils/FTexture2DBuilder
References
| Module | ModelingComponents |
| Header | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/AssetUtils/Texture2DBuilder.h |
| Include | #include "AssetUtils/Texture2DBuilder.h" |
template<typename PixelType>
static UTexture2D * BuildTextureFromImage
(
const TImageBuilder < PixelType > & SourceImage,
FTexture2DBuilder::ETextureType TextureType,
const bool bConvertToSRGB,
bool bPopulateSourceData
)
Remarks
Create a new UTexture2D of the given TextureType from the given SourceImage
Parameters
| Name | Description |
|---|---|
| bConvertToSRGB | if true, assumption is SourceImage is Linear and we want output UTexture2D to be SRGB. Only valid for 8-bit textures. |
| bPopulateSourceData | if true, first the PlatformData is initialized, then it is copied to the SourceData. This is necessary if the UTexture2D is going to be stored as an Asset (but can also be done explicitly using Commit()) |