You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added new materials to VREditorAssetContainer to avoid modifying the default materials used for WidgetComponents #rb zach.brockway, jason.walter#preflight 62d5c4b3d54af4b9a23b6111 #jira UE-157937 [CL 21152798 by richard graham in ue5-main branch]
37 lines
1004 B
C++
37 lines
1004 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "VREditorCameraWidgetComponent.h"
|
|
#include "IVREditorModule.h"
|
|
#include "VREditorAssetContainer.h"
|
|
#include "VREditorMode.h"
|
|
|
|
UVREditorCameraWidgetComponent::UVREditorCameraWidgetComponent()
|
|
: Super()
|
|
{
|
|
// Override this shader for VR camera viewfinders so that we get color-correct images.
|
|
//This shader does an sRGB -> Linear conversion and doesn't apply the "UI Brightness" setting .
|
|
|
|
if (UNLIKELY(IsRunningDedicatedServer()) || HasAnyFlags(RF_ClassDefaultObject)) // @todo vreditor: early out to avoid loading font assets in the cooker on Linux
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!IsRunningCommandlet())
|
|
{
|
|
if (IVREditorModule::IsAvailable())
|
|
{
|
|
IVREditorModule& VRModule = IVREditorModule::Get();
|
|
|
|
if (UVREditorMode* VRMode = VRModule.GetVRMode())
|
|
{
|
|
const UVREditorAssetContainer& VRAssetContainer = VRMode->GetAssetContainer();
|
|
{
|
|
OpaqueMaterial_OneSided = VRAssetContainer.CameraWidgetMaterial;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|