vault backup: 2024-07-22 11:11:05
This commit is contained in:
parent
ac1b85f4fd
commit
d0e8104f92
68
03-UnrealEngine/Rendering/RenderFeature/平面反射.md
Normal file
68
03-UnrealEngine/Rendering/RenderFeature/平面反射.md
Normal file
@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Untitled
|
||||
date: 2024-07-19 22:09:12
|
||||
excerpt:
|
||||
tags:
|
||||
rating: ⭐
|
||||
---
|
||||
|
||||
```c++
|
||||
for (auto It = SceneCaptureComponent->HiddenActors.CreateConstIterator(); It; ++It)
|
||||
{
|
||||
AActor* Actor = *It;
|
||||
|
||||
if (Actor)
|
||||
{
|
||||
for (UActorComponent* Component : Actor->GetComponents())
|
||||
{
|
||||
if (UPrimitiveComponent* PrimComp = Cast<UPrimitiveComponent>(Component))
|
||||
{
|
||||
View->HiddenPrimitives.Add(PrimComp->ComponentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SceneCaptureComponent->PrimitiveRenderMode == ESceneCapturePrimitiveRenderMode::PRM_UseShowOnlyList)
|
||||
{
|
||||
View->ShowOnlyPrimitives.Emplace();
|
||||
|
||||
for (auto It = SceneCaptureComponent->ShowOnlyComponents.CreateConstIterator(); It; ++It)
|
||||
{
|
||||
// If the primitive component was destroyed, the weak pointer will return NULL.
|
||||
UPrimitiveComponent* PrimitiveComponent = It->Get();
|
||||
if (PrimitiveComponent)
|
||||
{
|
||||
View->ShowOnlyPrimitives->Add(PrimitiveComponent->ComponentId);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto It = SceneCaptureComponent->ShowOnlyActors.CreateConstIterator(); It; ++It)
|
||||
{
|
||||
AActor* Actor = *It;
|
||||
|
||||
if (Actor)
|
||||
{
|
||||
for (UActorComponent* Component : Actor->GetComponents())
|
||||
{
|
||||
if (UPrimitiveComponent* PrimComp = Cast<UPrimitiveComponent>(Component))
|
||||
{
|
||||
View->ShowOnlyPrimitives->Add(PrimComp->ComponentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (SceneCaptureComponent->ShowOnlyComponents.Num() > 0 || SceneCaptureComponent->ShowOnlyActors.Num() > 0)
|
||||
{
|
||||
static bool bWarned = false;
|
||||
|
||||
if (!bWarned)
|
||||
{
|
||||
UE_LOG(LogRenderer, Log, TEXT("Scene Capture has ShowOnlyComponents or ShowOnlyActors ignored by the PrimitiveRenderMode setting! %s"), *SceneCaptureComponent->GetPathName());
|
||||
bWarned = true;
|
||||
}
|
||||
}
|
||||
|
||||
ViewFamily.Views.Add(View);
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user