diff --git a/CHANGELOG.md b/CHANGELOG.md index 6739d283b..62624b228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Bugfix about recorder query system * Fixed problem when vehicles enable autopilot after a replayer, now it works better. * Vulkan support: Changed project settings to make vulkan default on linux and updated make script to allow user to select opengl + * Updated scene capture sensor to add it's camera as a view to unreal's texture streamer each tick to enable texture streaming * Add ability to set motion blur settings for rgb camera in sensor python blueprint * Improved visual quality of the screen capture for the rgb sensor - Enabled Temporal AA for screen captures with no post-processing to prevent jaggies during motion diff --git a/Unreal/CarlaUE4/Config/DefaultEngine.ini b/Unreal/CarlaUE4/Config/DefaultEngine.ini index 6959e44f5..e507b5e20 100644 --- a/Unreal/CarlaUE4/Config/DefaultEngine.ini +++ b/Unreal/CarlaUE4/Config/DefaultEngine.ini @@ -28,7 +28,7 @@ r.DefaultFeature.AmbientOcclusionStaticFraction=False r.DefaultFeature.AutoExposure=False r.CustomDepth=3 r.Streaming.PoolSize=2000 -r.TextureStreaming=False +r.TextureStreaming=True r.GenerateMeshDistanceFields=True r.DistanceFieldBuild.EightBit=False r.DistanceFieldBuild.Compress=False @@ -86,13 +86,4 @@ InitialAverageFrameRate=0.016667 PhysXTreeRebuildRate=10 DefaultBroadphaseSettings=(bUseMBPOnClient=False,bUseMBPOnServer=False,MBPBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPNumSubdivs=2) -[/Script/LinuxTargetPlatform.LinuxTargetSettings] -SpatializationPlugin= -ReverbPlugin= -OcclusionPlugin= --TargetedRHIs=SF_VULKAN_SM5 --TargetedRHIs=GLSL_430 -+TargetedRHIs=SF_VULKAN_SM5 -+TargetedRHIs=GLSL_430 - diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp index 5d67ef7a6..e871dd933 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp @@ -14,6 +14,7 @@ #include "Components/StaticMeshComponent.h" #include "Engine/TextureRenderTarget2D.h" #include "HighResScreenshot.h" +#include "ContentStreaming.h" static auto SCENE_CAPTURE_COUNTER = 0u; @@ -174,6 +175,13 @@ void ASceneCaptureSensor::BeginPlay() Super::BeginPlay(); } +void ASceneCaptureSensor::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + // Add the view information every tick. Its only used for one tick and then removed by the streamer. + IStreamingManager::Get().AddViewInformation( DrawFrustum->GetComponentLocation(), ImageWidth, ImageWidth / FMath::Tan( CaptureComponent2D->FOVAngle ) ); +} + void ASceneCaptureSensor::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.h index 1c462c3e4..aa5bce567 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.h @@ -117,6 +117,8 @@ protected: virtual void BeginPlay() override; + virtual void Tick(float DeltaTime) override; + virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; virtual void SetUpSceneCaptureComponent(USceneCaptureComponent2D &SceneCapture) {}