本文整理汇总了C++中UMaterial::IsTextureForceRecompileCacheRessource方法的典型用法代码示例。如果您正苦于以下问题:C++ UMaterial::IsTextureForceRecompileCacheRessource方法的具体用法?C++ UMaterial::IsTextureForceRecompileCacheRessource怎么用?C++ UMaterial::IsTextureForceRecompileCacheRessource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMaterial
的用法示例。
在下文中一共展示了UMaterial::IsTextureForceRecompileCacheRessource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PostEditChangeProperty
void UTexture::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);
SetLightingGuid();
// Determine whether any property that requires recompression of the texture, or notification to Materials has changed.
bool RequiresNotifyMaterials = false;
bool DeferCompressionWasEnabled = false;
UProperty* PropertyThatChanged = PropertyChangedEvent.Property;
if( PropertyThatChanged )
{
static const FName CompressionSettingsName("CompressionSettings");
static const FName LODGroupName("LODGroup");
static const FName DeferCompressionName("DeferCompression");
#if WITH_EDITORONLY_DATA
static const FName MaxTextureSizeName("MaxTextureSize");
#endif // #if WITH_EDITORONLY_DATA
const FName PropertyName = PropertyThatChanged->GetFName();
if (PropertyName == CompressionSettingsName || PropertyName == LODGroupName)
{
RequiresNotifyMaterials = true;
}
else if (PropertyName == DeferCompressionName)
{
DeferCompressionWasEnabled = DeferCompression;
}
#if WITH_EDITORONLY_DATA
else if (PropertyName == MaxTextureSizeName)
{
if (MaxTextureSize <= 0)
{
MaxTextureSize = 0;
}
else
{
MaxTextureSize = FMath::Min<int32>(FMath::RoundUpToPowerOfTwo(MaxTextureSize), GetMaximumDimension());
}
}
#endif // #if WITH_EDITORONLY_DATA
bool bPreventSRGB = (CompressionSettings == TC_Alpha || CompressionSettings == TC_Normalmap || CompressionSettings == TC_Masks || CompressionSettings == TC_HDR || CompressionSettings == TC_HDR_Compressed);
if(bPreventSRGB && SRGB == true)
{
SRGB = false;
}
}
else
{
FMaterialUpdateContext UpdateContext;
// Update any material that uses this texture
TSet<UMaterial*> BaseMaterialsThatUseThisTexture;
for (TObjectIterator<UMaterialInterface> It; It; ++It)
{
UMaterialInterface* MaterialInterface = *It;
if (DoesMaterialUseTexture(MaterialInterface, this))
{
UMaterial *Material = MaterialInterface->GetMaterial();
bool MaterialAlreadyCompute = false;
BaseMaterialsThatUseThisTexture.Add(Material, &MaterialAlreadyCompute);
if (!MaterialAlreadyCompute)
{
UpdateContext.AddMaterial(Material);
if (Material->IsTextureForceRecompileCacheRessource(this))
{
Material->UpdateMaterialShaderCacheAndTextureReferences();
}
}
}
}
//If the DDC key was different the material is already recompile here
RequiresNotifyMaterials = false;
}
NumCinematicMipLevels = FMath::Max<int32>( NumCinematicMipLevels, 0 );
// Don't update the texture resource if we've turned "DeferCompression" on, as this
// would cause it to immediately update as an uncompressed texture
if( !DeferCompressionWasEnabled && (PropertyChangedEvent.ChangeType & EPropertyChangeType::Interactive) == 0 )
{
// Update the texture resource. This will recache derived data if necessary
// which may involve recompressing the texture.
UpdateResource();
}
// Notify any loaded material instances if changed our compression format
if (RequiresNotifyMaterials)
{
TArray<UMaterialInterface*> MaterialsThatUseThisTexture;
// Create a material update context to safely update materials.
{
FMaterialUpdateContext UpdateContext;
// Notify any material that uses this texture
TSet<UMaterial*> BaseMaterialsThatUseThisTexture;
for (TObjectIterator<UMaterialInterface> It; It; ++It)
{
//.........这里部分代码省略.........