177 GEngine->Exec(world, TEXT(
"r.DefaultFeature.MotionBlur 0"));
178 GEngine->Exec(world, TEXT(
"r.DefaultFeature.Bloom 0"));
179 GEngine->Exec(world, TEXT(
"r.DefaultFeature.AmbientOcclusion 0"));
180 GEngine->Exec(world, TEXT(
"r.AmbientOcclusionLevels 0"));
181 GEngine->Exec(world, TEXT(
"r.DefaultFeature.AmbientOcclusionStaticFraction 0"));
182 GEngine->Exec(world, TEXT(
"r.RHICmdBypass 0"));
183 GEngine->Exec(world, TEXT(
"r.DefaultFeature.AntiAliasing 1"));
184 GEngine->Exec(world, TEXT(
"r.Streaming.PoolSize 2000"));
185 GEngine->Exec(world, TEXT(
"r.HZBOcclusion 0"));
186 GEngine->Exec(world, TEXT(
"r.MinScreenRadiusForLights 0.01"));
187 GEngine->Exec(world, TEXT(
"r.SeparateTranslucency 0"));
188 GEngine->Exec(world, TEXT(
"r.FinishCurrentFrame 0"));
189 GEngine->Exec(world, TEXT(
"r.MotionBlurQuality 0"));
190 GEngine->Exec(world, TEXT(
"r.PostProcessAAQuality 0"));
191 GEngine->Exec(world, TEXT(
"r.BloomQuality 1"));
192 GEngine->Exec(world, TEXT(
"r.SSR.Quality 0"));
193 GEngine->Exec(world, TEXT(
"r.DepthOfFieldQuality 0"));
194 GEngine->Exec(world, TEXT(
"r.SceneColorFormat 2"));
195 GEngine->Exec(world, TEXT(
"r.TranslucencyVolumeBlur 0"));
196 GEngine->Exec(world, TEXT(
"r.TranslucencyLightingVolumeDim 4"));
197 GEngine->Exec(world, TEXT(
"r.MaxAnisotropy 8"));
198 GEngine->Exec(world, TEXT(
"r.LensFlareQuality 0"));
199 GEngine->Exec(world, TEXT(
"r.SceneColorFringeQuality 0"));
200 GEngine->Exec(world, TEXT(
"r.FastBlurThreshold 0"));
201 GEngine->Exec(world, TEXT(
"r.SSR.MaxRoughness 0.1"));
202 GEngine->Exec(world, TEXT(
"r.AllowOcclusionQueries 1"));
203 GEngine->Exec(world, TEXT(
"r.SSR 0"));
205 GEngine->Exec(world, TEXT(
"r.EarlyZPass 2"));
206 GEngine->Exec(world, TEXT(
"r.EarlyZPassMovable 1"));
207 GEngine->Exec(world, TEXT(
"Foliage.DitheredLOD 0"));
209 GEngine->Exec(world, TEXT(
"sg.PostProcessQuality 0"));
212 GEngine->Exec(world, TEXT(
"sg.ShadowQuality 0"));
213 GEngine->Exec(world, TEXT(
"sg.TextureQuality 0"));
214 GEngine->Exec(world, TEXT(
"sg.EffectsQuality 0"));
215 GEngine->Exec(world, TEXT(
"sg.FoliageQuality 0"));
216 GEngine->Exec(world, TEXT(
"foliage.DensityScale 0"));
217 GEngine->Exec(world, TEXT(
"grass.DensityScale 0"));
218 GEngine->Exec(world, TEXT(
"r.TranslucentLightingVolume 0"));
219 GEngine->Exec(world, TEXT(
"r.LightShaftDownSampleFactor 4"));
220 GEngine->Exec(world, TEXT(
"r.OcclusionQueryLocation 1"));
223 GEngine->Exec(world, TEXT(
"r.DefaultFeature.AutoExposure 1"));
229 const float max_draw_distance,
230 const TArray<FStaticMaterial> &road_pieces_materials)
const
232 if (!world || !
IsValid(world) || world->IsPendingKill())
236 AsyncTask(ENamedThreads::GameThread, [=]() {
237 if (!world || !
IsValid(world) || world->IsPendingKill())
241 TArray<AActor *> actors;
244 for (int32 i = 0; i < actors.Num(); i++)
246 AActor *actor = actors[i];
247 if (!
IsValid(actor) || actor->IsPendingKill())
251 TArray<UStaticMeshComponent *> components;
252 actor->GetComponents(components);
253 for (int32 j = 0; j < components.Num(); j++)
255 UStaticMeshComponent *staticmeshcomponent = Cast<UStaticMeshComponent>(components[j]);
256 if (staticmeshcomponent)
258 staticmeshcomponent->bAllowCullDistanceVolume = (max_draw_distance > 0);
259 staticmeshcomponent->bUseAsOccluder =
false;
260 staticmeshcomponent->LDMaxDrawDistance = max_draw_distance;
261 staticmeshcomponent->CastShadow = (max_draw_distance == 0);
262 if (road_pieces_materials.Num() > 0)
264 TArray<FName> meshslotsnames = staticmeshcomponent->GetMaterialSlotNames();
265 for (int32 k = 0; k < meshslotsnames.Num(); k++)
267 const FName &slotname = meshslotsnames[k];
268 road_pieces_materials.ContainsByPredicate(
269 [staticmeshcomponent, slotname](
const FStaticMaterial &material)
271 if (material.MaterialSlotName.IsEqual(slotname))
273 staticmeshcomponent->SetMaterial(
274 staticmeshcomponent->GetMaterialIndex(slotname),
275 material.MaterialInterface);
323 if (!world || !
IsValid(world) || world->IsPendingKill())
327 AsyncTask(ENamedThreads::GameThread, [=]() {
328 if (!world || !
IsValid(world) || world->IsPendingKill())
332 TArray<AActor *> actors;
334 UGameplayStatics::GetAllActorsOfClass(world, AActor::StaticClass(), actors);
335 for (int32 i = 0; i < actors.Num(); i++)
337 AActor *actor = actors[i];
338 if (!
IsValid(actor) || actor->IsPendingKill() ||
339 actor->IsA<AInstancedFoliageActor>() ||
341 actor->IsA<ALandscape>() ||
378 GEngine->Exec(world, TEXT(
"r.AmbientOcclusionLevels -1"));
379 GEngine->Exec(world, TEXT(
"r.RHICmdBypass 1"));
380 GEngine->Exec(world, TEXT(
"r.DefaultFeature.AntiAliasing 1"));
381 GEngine->Exec(world, TEXT(
"r.Streaming.PoolSize 2000"));
382 GEngine->Exec(world, TEXT(
"r.MinScreenRadiusForLights 0.03"));
383 GEngine->Exec(world, TEXT(
"r.SeparateTranslucency 1"));
384 GEngine->Exec(world, TEXT(
"r.PostProcessAAQuality 4"));
385 GEngine->Exec(world, TEXT(
"r.BloomQuality 5"));
386 GEngine->Exec(world, TEXT(
"r.SSR.Quality 3"));
387 GEngine->Exec(world, TEXT(
"r.DepthOfFieldQuality 2"));
388 GEngine->Exec(world, TEXT(
"r.SceneColorFormat 4"));
389 GEngine->Exec(world, TEXT(
"r.TranslucencyVolumeBlur 1"));
390 GEngine->Exec(world, TEXT(
"r.TranslucencyLightingVolumeDim 64"));
391 GEngine->Exec(world, TEXT(
"r.MaxAnisotropy 8"));
392 GEngine->Exec(world, TEXT(
"r.LensFlareQuality 2"));
393 GEngine->Exec(world, TEXT(
"r.SceneColorFringeQuality 1"));
394 GEngine->Exec(world, TEXT(
"r.FastBlurThreshold 100"));
395 GEngine->Exec(world, TEXT(
"r.SSR.MaxRoughness -1"));
397 GEngine->Exec(world, TEXT(
"r.EarlyZPass 3"));
398 GEngine->Exec(world, TEXT(
"r.EarlyZPassMovable 1"));
399 GEngine->Exec(world, TEXT(
"Foliage.DitheredLOD 1"));
400 GEngine->Exec(world, TEXT(
"sg.PostProcessQuality 3"));
401 GEngine->Exec(world, TEXT(
"r.ViewDistanceScale 1"));
403 GEngine->Exec(world, TEXT(
"sg.ShadowQuality 3"));
404 GEngine->Exec(world, TEXT(
"sg.TextureQuality 3"));
405 GEngine->Exec(world, TEXT(
"sg.EffectsQuality 3"));
406 GEngine->Exec(world, TEXT(
"sg.FoliageQuality 3"));
407 GEngine->Exec(world, TEXT(
"foliage.DensityScale 1"));
408 GEngine->Exec(world, TEXT(
"grass.DensityScale 1"));
409 GEngine->Exec(world, TEXT(
"r.TranslucentLightingVolume 1"));
410 GEngine->Exec(world, TEXT(
"r.LightShaftDownSampleFactor 2"));
413 GEngine->Exec(world, TEXT(
"r.DetailMode 2"));
418 const float max_distance_fade,
419 const bool cast_shadows,
420 const bool hide_non_directional)
const
422 if (!world || !
IsValid(world) || world->IsPendingKill())
426 AsyncTask(ENamedThreads::GameThread, [=]() {
427 if (!world || !
IsValid(world) || world->IsPendingKill())
431 TArray<AActor *> actors;
432 UGameplayStatics::GetAllActorsOfClass(world, ALight::StaticClass(), actors);
433 for (int32 i = 0; i < actors.Num(); i++)
435 if (!
IsValid(actors[i]) || actors[i]->IsPendingKill())
440 ADirectionalLight *directionallight = Cast<ADirectionalLight>(actors[i]);
441 if (directionallight)
443 directionallight->SetCastShadows(cast_shadows);
444 directionallight->SetLightFunctionFadeDistance(max_distance_fade);
448 actors[i]->SetActorHiddenInGame(hide_non_directional);