You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* For thumbnail renderers, the prototype of RenderViewFamily (which is called by all the types of thumbnail renderers) has been changed to take a non-const FSceneView* parameter (so that SetupView can be called on it) and the various GetView functions have been renamed CreateView since it more accurately depicts what the functions do (plus they return the non-const view they've created) * UGameViewportClient::Draw was calling SetupViewFamily but not SetupView * Made sure FSceneRenderer::ViewExtensionPreRender_RenderThread is called right before RenderThreadBegin for all code paths * Made sure view extensions are gathered for all code paths rendering a view family Note: BeginRenderViewFamily (i.e. game-thread), PostRenderView_RenderThread and PostRenderViewFamily_RenderThread are still not called on the non-standard code paths #jira UE-140273, UE-140489, UE-139067, UE-140425 #rb sebastien.lussier, rob.srinivasiah #tests EngineTests (screenshots), editor #preflight 61fd216ae17efe76d1b49a2d #lockdown mihnea.balta #ROBOMERGE-AUTHOR: jonathan.bard #ROBOMERGE-SOURCE: CL 18884880 in //UE5/Release-5.0/... via CL 18884941 via CL 18885221 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042) [CL 18885607 by jonathan bard in ue5-main branch]
57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "GeometryCacheThumbnailRenderer.h"
|
|
#include "Misc/App.h"
|
|
#include "ShowFlags.h"
|
|
#include "SceneView.h"
|
|
#include "GeometryCacheThumbnailScene.h"
|
|
#include "GeometryCache.h"
|
|
|
|
UGeometryCacheThumbnailRenderer::UGeometryCacheThumbnailRenderer(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
ThumbnailScene = nullptr;
|
|
}
|
|
|
|
void UGeometryCacheThumbnailRenderer::Draw(UObject* Object, int32 X, int32 Y, uint32 Width, uint32 Height, FRenderTarget* RenderTarget, FCanvas* Canvas, bool bAdditionalViewFamily)
|
|
{
|
|
UGeometryCache* GeometryCache = Cast<UGeometryCache>(Object);
|
|
if (IsValid(GeometryCache))
|
|
{
|
|
if (ThumbnailScene == nullptr)
|
|
{
|
|
ThumbnailScene = new FGeometryCacheThumbnailScene();
|
|
}
|
|
|
|
ThumbnailScene->SetGeometryCache(GeometryCache);
|
|
ThumbnailScene->GetScene()->UpdateSpeedTreeWind(0.0);
|
|
|
|
FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues(RenderTarget, ThumbnailScene->GetScene(), FEngineShowFlags(ESFIM_Game))
|
|
.SetTime(UThumbnailRenderer::GetTime())
|
|
.SetAdditionalViewFamily(bAdditionalViewFamily));
|
|
|
|
ViewFamily.EngineShowFlags.DisableAdvancedFeatures();
|
|
ViewFamily.EngineShowFlags.MotionBlur = 0;
|
|
ViewFamily.EngineShowFlags.LOD = 0;
|
|
|
|
RenderViewFamily(Canvas, &ViewFamily, ThumbnailScene->CreateView(&ViewFamily, X, Y, Width, Height));
|
|
ThumbnailScene->SetGeometryCache(nullptr);
|
|
}
|
|
}
|
|
|
|
void UGeometryCacheThumbnailRenderer::BeginDestroy()
|
|
{
|
|
if (ThumbnailScene != nullptr)
|
|
{
|
|
delete ThumbnailScene;
|
|
ThumbnailScene = nullptr;
|
|
}
|
|
|
|
Super::BeginDestroy();
|
|
}
|
|
|
|
bool UGeometryCacheThumbnailRenderer::AllowsRealtimeThumbnails(UObject* Object) const
|
|
{
|
|
return false;
|
|
}
|