From d0e8104f922bf933a9528afa3d45c49de5fc9776 Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Mon, 22 Jul 2024 11:11:05 +0800 Subject: [PATCH] vault backup: 2024-07-22 11:11:05 --- .../Rendering/RenderFeature/平面反射.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 03-UnrealEngine/Rendering/RenderFeature/平面反射.md diff --git a/03-UnrealEngine/Rendering/RenderFeature/平面反射.md b/03-UnrealEngine/Rendering/RenderFeature/平面反射.md new file mode 100644 index 0000000..336453b --- /dev/null +++ b/03-UnrealEngine/Rendering/RenderFeature/平面反射.md @@ -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); +``` \ No newline at end of file