更新 Source/FLESH/Private/Gore/SplatterMapSystem.cpp

This commit is contained in:
2025-04-21 17:59:40 +08:00
parent 305c0c8f4b
commit 2d68facb69

View File

@@ -162,10 +162,10 @@ void USplatterMapSystem::ClearSplatterMaps()
// Clear the render target // Clear the render target
UKismetRenderingLibrary::ClearRenderTarget2D(GetWorld(), RenderTarget); UKismetRenderingLibrary::ClearRenderTarget2D(GetWorld(), RenderTarget);
// 注意:ExportRenderTarget函数不能直接将RenderTarget复制到Texture2D // Note: ExportRenderTarget function cannot directly copy RenderTarget to Texture2D
// 我们需要使用其他方法来实现这一功能 // We need to use other methods to achieve this functionality
// 临时解决方案:简化实现,暂时不复制纹理内容 // Temporary solution: simplified implementation, not copying texture content for now
// 在实际项目中,需要实现一个自定义的纹理复制方法 // In actual projects, a custom texture copy method needs to be implemented
// UMaterialInstanceDynamic* CopyMaterial = UMaterialInstanceDynamic::Create(UMaterial::GetDefaultMaterial(EMaterialDomain::Surface), this); // UMaterialInstanceDynamic* CopyMaterial = UMaterialInstanceDynamic::Create(UMaterial::GetDefaultMaterial(EMaterialDomain::Surface), this);
// CopyMaterial->SetTextureParameterValue(TEXT("Texture"), RenderTarget); // CopyMaterial->SetTextureParameterValue(TEXT("Texture"), RenderTarget);
@@ -233,12 +233,12 @@ void USplatterMapSystem::RenderToSplatterMap(UTexture2D* TargetTexture, UTexture
DecalMaterial DecalMaterial
); );
// 注意:ExportRenderTarget函数不能直接将RenderTarget复制到Texture2D // Note: ExportRenderTarget function cannot directly copy RenderTarget to Texture2D
// 我们需要使用其他方法来实现这一功能 // We need to use other methods to achieve this functionality
// 临时解决方案:简化实现,暂时不复制纹理内容 // Temporary solution: simplified implementation, not copying texture content for now
// 在实际项目中,需要实现一个自定义的纹理复制方法 // In actual projects, a custom texture copy method needs to be implemented
// 例如,可以使用DrawMaterialToRenderTarget配合特殊材质来复制纹理 // For example, you can use DrawMaterialToRenderTarget with a special material to copy the texture
// 或者使用UE5的其他API来实现RenderTargetTexture2D的复制 // Or use UE5's other APIs to implement RenderTarget to Texture2D copy
// UKismetRenderingLibrary::ExportRenderTarget(GetWorld(), RenderTarget, TEXT(""), TargetTexture); // UKismetRenderingLibrary::ExportRenderTarget(GetWorld(), RenderTarget, TEXT(""), TargetTexture);
// Release the render target // Release the render target