本文整理汇总了C++中TAutoConsoleVariable::GetValueOnGameThread方法的典型用法代码示例。如果您正苦于以下问题:C++ TAutoConsoleVariable::GetValueOnGameThread方法的具体用法?C++ TAutoConsoleVariable::GetValueOnGameThread怎么用?C++ TAutoConsoleVariable::GetValueOnGameThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAutoConsoleVariable
的用法示例。
在下文中一共展示了TAutoConsoleVariable::GetValueOnGameThread方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetContactOffsetParams
void GetContactOffsetParams(float& ContactOffsetFactor, float& MaxContactOffset)
{
// Get contact offset params
ContactOffsetFactor = CVarContactOffsetFactor.GetValueOnGameThread();
MaxContactOffset = CVarMaxContactOffset.GetValueOnGameThread();
}
示例2: TickDemoRecord
void UDemoNetDriver::TickDemoRecord( float DeltaSeconds )
{
if ( ClientConnections.Num() == 0 )
{
return;
}
if ( FileAr == NULL )
{
return;
}
DemoDeltaTime += DeltaSeconds;
const double CurrentSeconds = FPlatformTime::Seconds();
const double RECORD_HZ = CVarDemoRecordHz.GetValueOnGameThread();
const double RECORD_DELAY = 1.0 / RECORD_HZ;
if ( CurrentSeconds - LastRecordTime < RECORD_DELAY )
{
return; // Not enough real-time has passed to record another frame
}
LastRecordTime = CurrentSeconds;
// Save out a frame
DemoFrameNum++;
ReplicationFrame++;
// Save elapsed game time
*FileAr << DemoDeltaTime;
#if DEMO_CHECKSUMS == 1
uint32 DeltaTimeChecksum = FCrc::MemCrc32( &DemoDeltaTime, sizeof( DemoDeltaTime ), 0 );
*FileAr << DeltaTimeChecksum;
#endif
DemoDeltaTime = 0;
// Make sure we don't have anything in the buffer for this new frame
check( ClientConnections[0]->SendBuffer.GetNumBits() == 0 );
bIsRecordingDemoFrame = true;
// Dump any queued packets
UDemoNetConnection * ClientDemoConnection = CastChecked< UDemoNetConnection >( ClientConnections[0] );
for ( int32 i = 0; i < ClientDemoConnection->QueuedDemoPackets.Num(); i++ )
{
ClientDemoConnection->LowLevelSend( (char*)&ClientDemoConnection->QueuedDemoPackets[i].Data[0], ClientDemoConnection->QueuedDemoPackets[i].Data.Num() );
}
ClientDemoConnection->QueuedDemoPackets.Empty();
const bool IsNetClient = ( GetWorld()->GetNetDriver() != NULL && GetWorld()->GetNetDriver()->GetNetMode() == NM_Client );
DemoReplicateActor( World->GetWorldSettings(), ClientConnections[0], IsNetClient );
for ( int32 i = 0; i < World->NetworkActors.Num(); i++ )
{
AActor* Actor = World->NetworkActors[i];
Actor->PreReplication( *FindOrCreateRepChangedPropertyTracker( Actor ).Get() );
DemoReplicateActor( Actor, ClientConnections[0], IsNetClient );
}
// Make sure nothing is left over
ClientConnections[0]->FlushNet();
check( ClientConnections[0]->SendBuffer.GetNumBits() == 0 );
bIsRecordingDemoFrame = false;
// Write a count of 0 to signal the end of the frame
int32 EndCount = 0;
*FileAr << EndCount;
}
示例3: CurrentAdapter
void FD3D12DynamicRHIModule::FindAdapter()
{
// Once we chosen one we don't need to do it again.
check(ChosenAdapter.IsValid() == 0);
// Try to create the DXGIFactory. This will fail if we're not running Vista.
TRefCountPtr<IDXGIFactory4> DXGIFactory;
SafeCreateDXGIFactory(DXGIFactory.GetInitReference());
if (!DXGIFactory)
{
return;
}
bool bAllowPerfHUD = true;
#if UE_BUILD_SHIPPING || UE_BUILD_TEST
bAllowPerfHUD = false;
#endif
int32 CVarValue = CVarGraphicsAdapter.GetValueOnGameThread();
const bool bFavorNonIntegrated = CVarValue == -1;
TRefCountPtr<IDXGIAdapter> TempAdapter;
D3D_FEATURE_LEVEL MaxAllowedFeatureLevel = GetAllowedD3DFeatureLevel();
FD3D12Adapter FirstWithoutIntegratedAdapter;
FD3D12Adapter FirstAdapter;
bool bIsAnyAMD = false;
bool bIsAnyIntel = false;
bool bIsAnyNVIDIA = false;
// Enumerate the DXGIFactory's adapters.
for (uint32 AdapterIndex = 0; DXGIFactory->EnumAdapters(AdapterIndex, TempAdapter.GetInitReference()) != DXGI_ERROR_NOT_FOUND; ++AdapterIndex)
{
// Check that if adapter supports D3D11.
if (TempAdapter)
{
D3D_FEATURE_LEVEL ActualFeatureLevel = (D3D_FEATURE_LEVEL)0;
if (SafeTestD3D12CreateDevice(TempAdapter, MaxAllowedFeatureLevel, &ActualFeatureLevel))
{
// Log some information about the available D3D12 adapters.
DXGI_ADAPTER_DESC AdapterDesc;
VERIFYD3D11RESULT(TempAdapter->GetDesc(&AdapterDesc));
uint32 OutputCount = CountAdapterOutputs(TempAdapter);
UE_LOG(LogD3D12RHI, Log,
TEXT("Found D3D12 adapter %u: %s (Feature Level %s)"),
AdapterIndex,
AdapterDesc.Description,
GetFeatureLevelString(ActualFeatureLevel)
);
UE_LOG(LogD3D12RHI, Log,
TEXT("Adapter has %uMB of dedicated video memory, %uMB of dedicated system memory, and %uMB of shared system memory, %d output[s]"),
(uint32)(AdapterDesc.DedicatedVideoMemory / (1024*1024)),
(uint32)(AdapterDesc.DedicatedSystemMemory / (1024*1024)),
(uint32)(AdapterDesc.SharedSystemMemory / (1024*1024)),
OutputCount
);
bool bIsAMD = AdapterDesc.VendorId == 0x1002;
bool bIsIntel = AdapterDesc.VendorId == 0x8086;
bool bIsNVIDIA = AdapterDesc.VendorId == 0x10DE;
bool bIsWARP = FParse::Param(FCommandLine::Get(), TEXT("warp"));
if (bIsAMD) bIsAnyAMD = true;
if (bIsIntel) bIsAnyIntel = true;
if (bIsNVIDIA) bIsAnyNVIDIA = true;
// Simple heuristic but without profiling it's hard to do better
const bool bIsIntegrated = bIsIntel;
// PerfHUD is for performance profiling
const bool bIsPerfHUD = !FCString::Stricmp(AdapterDesc.Description, TEXT("NVIDIA PerfHUD"));
FD3D12Adapter CurrentAdapter(AdapterIndex, ActualFeatureLevel);
if (!OutputCount && !bIsWARP)
{
// Add special check to support WARP, which does not have an output associated with it.
// This device has no outputs. Reject it,
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb205075%28v=vs.85%29.aspx#WARP_new_for_Win8
continue;
}
if(bIsPerfHUD && !bAllowPerfHUD)
{
// we don't allow the PerfHUD adapter
continue;
}
if (CVarValue >= 0 && AdapterIndex != CVarValue)
{
// the user wants a specific adapter, not this one
continue;
}
if (!bIsIntegrated && !FirstWithoutIntegratedAdapter.IsValid())
{
//.........这里部分代码省略.........
示例4: RHIDetectAndWarnOfBadDrivers
void RHIDetectAndWarnOfBadDrivers()
{
int32 CVarValue = CVarWarnOfBadDrivers.GetValueOnGameThread();
if(!GIsRHIInitialized || !CVarValue || GRHIVendorId == 0)
{
return;
}
FGPUDriverInfo DriverInfo;
// later we should make the globals use the struct directly
DriverInfo.VendorId = GRHIVendorId;
DriverInfo.DeviceDescription = GRHIAdapterName;
DriverInfo.ProviderName = TEXT("Unknown");
DriverInfo.InternalDriverVersion = GRHIAdapterInternalDriverVersion;
DriverInfo.UserDriverVersion = GRHIAdapterUserDriverVersion;
DriverInfo.DriverDate = GRHIAdapterDriverDate;
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
// for testing
if(CVarValue == 2)
{
DriverInfo.SetNVIDIA();
DriverInfo.DeviceDescription = TEXT("Test NVIDIA (bad)");
DriverInfo.UserDriverVersion = TEXT("346.43");
DriverInfo.InternalDriverVersion = TEXT("9.18.134.643");
DriverInfo.DriverDate = TEXT("01-01-1900");
}
else if(CVarValue == 3)
{
DriverInfo.SetAMD();
DriverInfo.DeviceDescription = TEXT("Test AMD (bad)");
DriverInfo.UserDriverVersion = TEXT("Test Catalyst Version");
DriverInfo.InternalDriverVersion = TEXT("13.152.1.1000");
DriverInfo.DriverDate = TEXT("09-10-13");
}
else if(CVarValue == 4)
{
DriverInfo.SetAMD();
DriverInfo.DeviceDescription = TEXT("Test AMD (good)");
DriverInfo.UserDriverVersion = TEXT("Test Catalyst Version");
DriverInfo.InternalDriverVersion = TEXT("15.30.1025.1001");
DriverInfo.DriverDate = TEXT("01-01-16");
}
else if(CVarValue == 5)
{
DriverInfo.SetIntel();
DriverInfo.DeviceDescription = TEXT("Test Intel (good)");
DriverInfo.UserDriverVersion = TEXT("Test Intel Version");
DriverInfo.InternalDriverVersion = TEXT("8.15.10.2302");
DriverInfo.DriverDate = TEXT("01-01-15");
}
#endif // !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
FGPUHardware DetectedGPUHardware(DriverInfo);
if (DriverInfo.IsValid())
{
FBlackListEntry BlackListEntry = DetectedGPUHardware.FindDriverBlacklistEntry();
if (BlackListEntry.IsValid())
{
bool bLatestBlacklisted = DetectedGPUHardware.IsLatestBlacklisted();
// Note: we don't localize the vendor's name.
FString VendorString = DriverInfo.ProviderName;
if (DriverInfo.IsNVIDIA())
{
VendorString = TEXT("NVIDIA");
}
else if (DriverInfo.IsAMD())
{
VendorString = TEXT("AMD");
}
else if (DriverInfo.IsIntel())
{
VendorString = TEXT("Intel");
}
// format message box UI
FFormatNamedArguments Args;
Args.Add(TEXT("AdapterName"), FText::FromString(DriverInfo.DeviceDescription));
Args.Add(TEXT("Vendor"), FText::FromString(VendorString));
Args.Add(TEXT("RecommendedVer"), FText::FromString(DetectedGPUHardware.GetSuggestedDriverVersion()));
Args.Add(TEXT("InstalledVer"), FText::FromString(DriverInfo.UserDriverVersion));
// this message can be suppressed with r.WarnOfBadDrivers=0
FText LocalizedMsg;
if (bLatestBlacklisted)
{
LocalizedMsg = FText::Format(NSLOCTEXT("MessageDialog", "LatestVideoCardDriverIssueReport","The latest version of the {Vendor} graphics driver has known issues.\n\nPlease install the last known good driver version.\n\n{AdapterName}\n{RecommendedVer} is the last known good\n{InstalledVer} is installed"),Args);
}
else
{
LocalizedMsg = FText::Format(NSLOCTEXT("MessageDialog", "VideoCardDriverIssueReport","Your {Vendor} graphics driver has known issues.\n\nPlease update to the latest driver version.\n\n{AdapterName}\n{RecommendedVer} is recommended\n{InstalledVer} is installed"),Args);
}
FPlatformMisc::MessageBoxExt(EAppMsgType::Ok,
//.........这里部分代码省略.........
示例5: InitGamePhys
//////// GAME-LEVEL RIGID BODY PHYSICS STUFF ///////
void InitGamePhys()
{
#if WITH_BOX2D
FPhysicsIntegration2D::InitializePhysics();
#endif
#if WITH_PHYSX
// Do nothing if SDK already exists
if(GPhysXFoundation != NULL)
{
return;
}
// Make sure
LoadPhysXModules();
// Create Foundation
GPhysXAllocator = new FPhysXAllocator();
FPhysXErrorCallback* ErrorCallback = new FPhysXErrorCallback();
GPhysXFoundation = PxCreateFoundation(PX_FOUNDATION_VERSION, *GPhysXAllocator, *ErrorCallback);
check(GPhysXFoundation);
#if PHYSX_MEMORY_STATS
// Want names of PhysX allocations
GPhysXFoundation->setReportAllocationNames(true);
#endif
// Create profile manager
GPhysXVisualDebugger = PxCreatePvd(*GPhysXFoundation);
check(GPhysXVisualDebugger);
// Create Physics
PxTolerancesScale PScale;
PScale.length = CVarToleranceScaleLength.GetValueOnGameThread();
PScale.speed = CVarToleranceScaleSpeed.GetValueOnGameThread();
GPhysXSDK = PxCreatePhysics(PX_PHYSICS_VERSION, *GPhysXFoundation, PScale, false, GPhysXVisualDebugger);
check(GPhysXSDK);
FPhysxSharedData::Initialize();
GPhysCommandHandler = new FPhysCommandHandler();
GPreGarbageCollectDelegateHandle = FCoreUObjectDelegates::PreGarbageCollect.AddRaw(GPhysCommandHandler, &FPhysCommandHandler::Flush);
// Init Extensions
PxInitExtensions(*GPhysXSDK, GPhysXVisualDebugger);
#if WITH_VEHICLE
PxInitVehicleSDK(*GPhysXSDK);
#endif
if (CVarUseUnifiedHeightfield.GetValueOnGameThread())
{
//Turn on PhysX 3.3 unified height field collision detection.
//This approach shares the collision detection code between meshes and height fields such that height fields behave identically to the equivalent terrain created as a mesh.
//This approach facilitates mixing the use of height fields and meshes in the application with no tangible difference in collision behavior between the two approaches except that
//heightfield thickness is not supported for unified heightfields.
PxRegisterUnifiedHeightFields(*GPhysXSDK);
}
else
{
PxRegisterHeightFields(*GPhysXSDK);
}
if( FParse::Param( FCommandLine::Get(), TEXT( "PVD" ) ) )
{
PvdConnect(TEXT("localhost"), true);
}
#if WITH_PHYSICS_COOKING || WITH_RUNTIME_PHYSICS_COOKING
// Create Cooking
PxCookingParams PCookingParams(PScale);
PCookingParams.meshWeldTolerance = 0.1f; // Weld to 1mm precision
PCookingParams.meshPreprocessParams = PxMeshPreprocessingFlags(PxMeshPreprocessingFlag::eWELD_VERTICES);
// Force any cooking in PhysX or APEX to use older incremental hull method
// This is because the new 'quick hull' method can generate degenerate geometry in some cases (very thin meshes etc.)
//PCookingParams.convexMeshCookingType = PxConvexMeshCookingType::eINFLATION_INCREMENTAL_HULL;
PCookingParams.targetPlatform = PxPlatform::ePC;
//PCookingParams.meshCookingHint = PxMeshCookingHint::eCOOKING_PERFORMANCE;
//PCookingParams.meshSizePerformanceTradeOff = 0.0f;
GPhysXCooking = PxCreateCooking(PX_PHYSICS_VERSION, *GPhysXFoundation, PCookingParams);
check(GPhysXCooking);
#endif
#if WITH_APEX
// Build the descriptor for the APEX SDK
apex::ApexSDKDesc ApexDesc;
ApexDesc.foundation = GPhysXFoundation; // Pointer to the PxFoundation
ApexDesc.physXSDK = GPhysXSDK; // Pointer to the PhysXSDK
ApexDesc.cooking = GPhysXCooking; // Pointer to the cooking library
ApexDesc.renderResourceManager = &GApexNullRenderResourceManager; // We will not be using the APEX rendering API, so just use a dummy render resource manager
ApexDesc.resourceCallback = &GApexResourceCallback; // The resource callback is how APEX asks the application to find assets when it needs them
#if PLATFORM_MAC
FString DylibFolder = FPaths::EngineDir() / TEXT("Binaries/ThirdParty/PhysX/");
ANSICHAR* DLLLoadPath = (ANSICHAR*)FMemory::Malloc(DylibFolder.Len() + 1);
FCStringAnsi::Strcpy(DLLLoadPath, DylibFolder.Len() + 1, TCHAR_TO_UTF8(*DylibFolder));
//.........这里部分代码省略.........
示例6: ApplyOverrides
void FSystemSettings::ApplyOverrides()
{
bool bUseMaxQualityMode = CVarUseMaxQualityMode.GetValueOnGameThread() != 0;
if (FParse::Param(FCommandLine::Get(),TEXT("MAXQUALITYMODE")))
{
bUseMaxQualityMode = true;
}
if (FParse::Param(FCommandLine::Get(),TEXT("MSAA")))
{
check(0);
// todo: set console variable to activate MSAA
}
if (!FPlatformProperties::SupportsWindowedMode())
{
bUseMaxQualityMode = false;
}
else
{
// Dump(TEXT("Startup System Settings:"));
}
if (bUseMaxQualityMode)
{
// Modify various system settings to get the best quality regardless of performance impact
{
auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.MinResolution"));
CVar->Set(16);
}
// Disable shadow fading out over distance
{
auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.FadeResolution"));
CVar->Set(1);
}
// Increase minimum preshadow resolution
{
auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.MinPreShadowResolution"));
CVar->Set(16);
}
// Disable preshadow fading out over distance
{
auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.PreShadowFadeResolution"));
CVar->Set(1);
}
// Increase shadow texel density
{
auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.TexelsPerPixel"));
CVar->Set(4.0f);
}
// Don't downsample preshadows
{
auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.PreShadowResolutionFactor"));
CVar->Set(1.0f);
}
for (int32 GroupIndex = 0; GroupIndex < TEXTUREGROUP_MAX; GroupIndex++)
{
FTextureLODSettings::FTextureLODGroup& CurrentGroup = TextureLODSettings.GetTextureLODGroup(GroupIndex);
// Use the best quality texture filtering
CurrentGroup.Filter = SF_AnisotropicLinear;
// Raise texture max sizes to 4096
CurrentGroup.MinLODMipCount = 12;
CurrentGroup.MaxLODMipCount = 12;
CurrentGroup.LODBias = -1000;
}
}
}
示例7: DrawNewGrid
void FGridWidget::DrawNewGrid(const FSceneView* View, FPrimitiveDrawInterface* PDI)
{
if(LevelGridMaterial->IsCompilingOrHadCompileError() || LevelGridMaterial2->IsCompilingOrHadCompileError())
{
// The material would appear to be black (because we don't use a MaterialDomain but a UsageFlag - we should change that).
// Here we rather want to hide it.
return;
}
bool bUseTextureSolution = CVarEditorNewLevelGrid.GetValueOnGameThread() > 1;
UMaterialInstanceDynamic *MaterialInst = bUseTextureSolution ? LevelGridMaterialInst2 : LevelGridMaterialInst;
if(!MaterialInst)
{
return;
}
bool bMSAA = IsEditorCompositingMSAAEnabled();
bool bIsPerspective = ( View->ViewMatrices.ProjMatrix.M[3][3] < 1.0f );
// 0: off, in unreal units
float SnapGridSize = 0.0f;
if(GetDefault<ULevelEditorViewportSettings>()->GridEnabled)
{
SnapGridSize = GEditor->GetGridSize();
}
float SnapAlphaMultiplier = 1.0f;
if(SnapGridSize <= 0.0f)
{
// to hide the snap in the texture based solution
SnapAlphaMultiplier = 0;
}
// to get a light grid in a black level but use a high opacity value to be able to see it in a bright level
const float Darken = 0.11f;
if(bIsPerspective)
{
MaterialInst->SetVectorParameterValue("GridColor", FLinearColor(0.6f * Darken, 0.6f * Darken, 0.6f * Darken, CVarEditor3DGridFade.GetValueOnGameThread()));
MaterialInst->SetVectorParameterValue("SnapColor", FLinearColor(0.5f, 0.0f, 0.0f, SnapAlphaMultiplier * CVarEditor3DSnapFade.GetValueOnGameThread()));
}
else
{
MaterialInst->SetVectorParameterValue("GridColor", FLinearColor(0.6f * Darken, 0.6f * Darken, 0.6f * Darken, CVarEditor2DGridFade.GetValueOnGameThread()));
MaterialInst->SetVectorParameterValue("SnapColor", FLinearColor(0.5f, 0.0f, 0.0f, SnapAlphaMultiplier * CVarEditor2DSnapFade.GetValueOnGameThread()));
}
// true:1m, false:1dm ios smallest grid size
bool bLarger1mGrid = true;
const int Exponent = 10;
// 2 is the default so we need to set it
MaterialInst->SetScalarParameterValue("Exponent", (float)Exponent);
// without MSAA we need the grid to be more see through so lines behind it can be recognized
MaterialInst->SetScalarParameterValue("AlphaBias", bMSAA ? 0.0f : 0.05f);
// grid for size
float GridSplit = 0.5f;
// red dots to visualize the snap
float SnapSplit = 0.075f;
float WorldToUVScale = 0.001f;
if(bLarger1mGrid)
{
WorldToUVScale *= 0.1f;
GridSplit *= 0.1f;
}
// in 2D all grid lines are same size in world space (they are at different scale so we need to adjust here)
FLinearColor GridSplitTriple(GridSplit * 0.01f, GridSplit * 0.1f, GridSplit);
if(bIsPerspective)
{
// largest grid lines
GridSplitTriple.R *= 8.0f;
// medium grid lines
GridSplitTriple.G *= 3.0f;
// fine grid lines
GridSplitTriple.B *= 1.0f;
}
if(!bIsPerspective)
{
// screenspace size looks better in 2d
float ScaleX = View->ViewMatrices.ProjMatrix.M[0][0] * View->ViewRect.Width();
float ScaleY = View->ViewMatrices.ProjMatrix.M[1][1] * View->ViewRect.Height();
float Scale = FMath::Min(ScaleX, ScaleY);
float GridScale = CVarEditor2DSnapScale.GetValueOnGameThread();
float GridMin = CVarEditor2DSnapMin.GetValueOnGameThread();
//.........这里部分代码省略.........
示例8: StartFinalPostprocessSettings
void FSceneView::StartFinalPostprocessSettings(FVector InViewLocation)
{
check(IsInGameThread());
// The final settings for the current viewer position (blended together from many volumes).
// Setup by the main thread, passed to the render thread and never touched again by the main thread.
// Set values before any override happens.
FinalPostProcessSettings.SetBaseValues();
// project settings might want to have different defaults
{
if(!CVarDefaultBloom.GetValueOnGameThread())
{
FinalPostProcessSettings.BloomIntensity = 0;
}
if (!CVarDefaultAmbientOcclusion.GetValueOnGameThread())
{
FinalPostProcessSettings.AmbientOcclusionIntensity = 0;
}
if (!CVarDefaultAutoExposure.GetValueOnGameThread())
{
FinalPostProcessSettings.AutoExposureMinBrightness = 1;
FinalPostProcessSettings.AutoExposureMaxBrightness = 1;
}
if (!CVarDefaultMotionBlur.GetValueOnGameThread())
{
FinalPostProcessSettings.MotionBlurAmount = 0;
}
if (!CVarDefaultLensFlare.GetValueOnGameThread())
{
FinalPostProcessSettings.LensFlareIntensity = 0;
}
{
int32 Value = CVarDefaultAntiAliasing.GetValueOnGameThread();
if (Value >= 0 && Value < AAM_MAX)
{
FinalPostProcessSettings.AntiAliasingMethod = (EAntiAliasingMethod)Value;
}
}
{
int32 Value = CVarDefaultAmbientOcclusionStaticFraction.GetValueOnGameThread();
if(!Value)
{
FinalPostProcessSettings.AmbientOcclusionStaticFraction = 0.0f;
}
}
}
if(State)
{
State->OnStartPostProcessing(*this);
}
UWorld* World = Family->Scene->GetWorld();
// Some views have no world (e.g. material preview)
if (World)
{
for (auto VolumeIt = World->PostProcessVolumes.CreateIterator(); VolumeIt; ++VolumeIt)
{
DoPostProcessVolume(*VolumeIt, InViewLocation, this);
}
}
}
示例9: EndFinalPostprocessSettings
void FSceneView::EndFinalPostprocessSettings(const FSceneViewInitOptions& ViewInitOptions)
{
{
static const auto CVarMobileMSAA = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.MobileMSAA"));
if(CVarMobileMSAA ? CVarMobileMSAA->GetValueOnGameThread() > 1 : false)
{
// Turn off various features which won't work with mobile MSAA.
FinalPostProcessSettings.DepthOfFieldScale = 0.0f;
FinalPostProcessSettings.AntiAliasingMethod = AAM_None;
}
}
{
static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.BloomQuality"));
int Value = CVar->GetValueOnGameThread();
if(Value <= 0)
{
FinalPostProcessSettings.BloomIntensity = 0.0f;
}
}
if(!Family->EngineShowFlags.Bloom)
{
FinalPostProcessSettings.BloomIntensity = 0.0f;
}
if(!Family->EngineShowFlags.GlobalIllumination)
{
FinalPostProcessSettings.LPVIntensity = 0.0f;
}
{
static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.DepthOfFieldQuality"));
int Value = CVar->GetValueOnGameThread();
if(Value <= 0)
{
FinalPostProcessSettings.DepthOfFieldScale = 0.0f;
}
}
if(!Family->EngineShowFlags.DepthOfField)
{
FinalPostProcessSettings.DepthOfFieldScale = 0;
}
if(!Family->EngineShowFlags.Vignette)
{
FinalPostProcessSettings.VignetteIntensity = 0;
FinalPostProcessSettings.VignetteColor = FLinearColor(0.0f, 0.0f, 0.0f);
}
if(!Family->EngineShowFlags.Grain)
{
FinalPostProcessSettings.GrainIntensity = 0;
FinalPostProcessSettings.GrainJitter = 0;
}
if(!Family->EngineShowFlags.CameraImperfections)
{
FinalPostProcessSettings.BloomDirtMaskIntensity = 0;
}
if(!Family->EngineShowFlags.AmbientCubemap)
{
FinalPostProcessSettings.ContributingCubemaps.Empty();
}
if(!Family->EngineShowFlags.LensFlares)
{
FinalPostProcessSettings.LensFlareIntensity = 0;
}
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
{
float Value = CVarExposureOffset.GetValueOnGameThread();
FinalPostProcessSettings.AutoExposureBias += Value;
}
#endif
{
static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.ScreenPercentage"));
float Value = CVar->GetValueOnGameThread();
if(Value >= 0.0)
{
FinalPostProcessSettings.ScreenPercentage = Value;
}
}
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
{
float Value = CVarSSRMaxRoughness.GetValueOnGameThread();
if(Value >= 0.0f)
{
//.........这里部分代码省略.........
示例10: ApplyOverrides
void FSystemSettings::ApplyOverrides()
{
EConsoleVariableFlags SetBy = ECVF_SetByMask;
if (FPlatformProperties::SupportsWindowedMode())
{
if (CVarUseMaxQualityMode.GetValueOnGameThread() != 0)
{
SetBy = (EConsoleVariableFlags)(CVarUseMaxQualityMode.AsVariable()->GetFlags() & ECVF_SetByMask);
}
if (FParse::Param(FCommandLine::Get(),TEXT("MAXQUALITYMODE")))
{
SetBy = ECVF_SetByCommandline;
}
}
if (SetBy != ECVF_SetByMask)
{
// Modify various system settings to get the best quality regardless of performance impact
{
static auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.MinResolution"));
CVar->Set(16, SetBy);
}
// Disable shadow fading out over distance
{
static auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.FadeResolution"));
CVar->Set(1, SetBy);
}
// Increase minimum preshadow resolution
{
static auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.MinPreShadowResolution"));
CVar->Set(16, SetBy);
}
// Disable preshadow fading out over distance
{
static auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.PreShadowFadeResolution"));
CVar->Set(1, SetBy);
}
// Increase shadow texel density
{
static auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.TexelsPerPixel"));
CVar->Set(4.0f, SetBy);
}
// Don't downsample preshadows
{
static auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Shadow.PreShadowResolutionFactor"));
CVar->Set(1.0f, SetBy);
}
for (int32 GroupIndex = 0; GroupIndex < TEXTUREGROUP_MAX; GroupIndex++)
{
FTextureLODSettings::FTextureLODGroup& CurrentGroup = TextureLODSettings.GetTextureLODGroup(GroupIndex);
// Use the best quality texture filtering
CurrentGroup.Filter = SF_AnisotropicLinear;
// Raise texture max sizes to 4096
CurrentGroup.MinLODMipCount = 12;
CurrentGroup.MaxLODMipCount = 12;
CurrentGroup.LODBias = -1000;
}
}
}