void UGeometryCacheComponent::UpdateTrackSectionMeshData(int32 SectionIndex, FGeometryCacheMeshData* MeshData) { // Check if the index is in range and Vertices contains any data check(SectionIndex < TrackSections.Num() && MeshData != nullptr && "Invalid SectionIndex or Mesh Data"); // Reset this section (in case it already existed) FTrackRenderData& UpdateSection = TrackSections[SectionIndex]; // Number of Vertices const int32 NumVerts = MeshData->Vertices.Num(); // Update MeshDataPointer UpdateSection.MeshData = MeshData; //if (SceneProxy) //{ // UpdateTrackSectionVertexbuffer(SectionIndex, MeshData); // UpdateTrackSectionIndexbuffer(SectionIndex, MeshData->Indices); // // Will update the bounds (used for frustum culling) // MarkRenderTransformDirty(); // MarkRenderDynamicDataDirty(); //} //else //{ // // Recreate scene proxy // MarkRenderStateDirty(); //} // Update overall bounds UpdateLocalBounds(); MarkRenderStateDirty(); }
void UMeshComponent::SetMaterial(int32 ElementIndex, UMaterialInterface* Material) { if (ElementIndex >= 0) { if (Materials.IsValidIndex(ElementIndex) && (Materials[ElementIndex] == Material)) { // Do nothing, the material is already set } else { // Grow the array if the new index is too large if (Materials.Num() <= ElementIndex) { Materials.AddZeroed(ElementIndex + 1 - Materials.Num()); } // Set the material and invalidate things Materials[ElementIndex] = Material; MarkRenderStateDirty(); if (BodyInstance.IsValidBodyInstance()) { BodyInstance.UpdatePhysicalMaterials(); } } } }
bool UPaperTileMapComponent::SetTileMap(class UPaperTileMap* NewTileMap) { if (NewTileMap != TileMap) { // Don't allow changing the tile map if we are "static". AActor* Owner = GetOwner(); if (!IsRegistered() || (Owner == nullptr) || (Mobility != EComponentMobility::Static)) { TileMap = NewTileMap; // Need to send this to render thread at some point MarkRenderStateDirty(); // Update physics representation right away RecreatePhysicsState(); // Since we have new mesh, we need to update bounds UpdateBounds(); return true; } } return false; }
void UGameplayDebuggingComponent::OnRep_UpdateEQS() { #if USE_EQS_DEBUGGER // decode scoring data if (World && World->GetNetMode() == NM_Client) { TArray<uint8> UncompressedBuffer; int32 UncompressedSize = 0; const int32 HeaderSize = sizeof(int32); uint8* SrcBuffer = (uint8*)EQSRepData.GetData(); FMemory::Memcpy(&UncompressedSize, SrcBuffer, HeaderSize); SrcBuffer += HeaderSize; const int32 CompressedSize = EQSRepData.Num() - HeaderSize; UncompressedBuffer.AddZeroed(UncompressedSize); FCompression::UncompressMemory((ECompressionFlags)(COMPRESS_ZLIB), (void*)UncompressedBuffer.GetData(), UncompressedSize, SrcBuffer, CompressedSize); FMemoryReader ArReader(UncompressedBuffer); ArReader << EQSLocalData; } UpdateBounds(); MarkRenderStateDirty(); #endif //USE_EQS_DEBUGGER }
void FGameplayDebuggerCategory_AI::OnDataPackReplicated(int32 DataPackId) { if (DataPackId == PathDataPackId) { MarkRenderStateDirty(); } }
void ULineBatchComponent::DrawBox(const FBox& Box, const FMatrix& TM, const FColor& Color, uint8 DepthPriorityGroup) { FVector B[2], P, Q; int32 ai, aj; B[0] = Box.Min; B[1] = Box.Max; for( ai=0; ai<2; ai++ ) for( aj=0; aj<2; aj++ ) { P.X=B[ai].X; Q.X=B[ai].X; P.Y=B[aj].Y; Q.Y=B[aj].Y; P.Z=B[0].Z; Q.Z=B[1].Z; new(BatchedLines) FBatchedLine(TM.TransformPosition(P), TM.TransformPosition(Q), Color, DefaultLifeTime, 0.0f, DepthPriorityGroup); P.Y=B[ai].Y; Q.Y=B[ai].Y; P.Z=B[aj].Z; Q.Z=B[aj].Z; P.X=B[0].X; Q.X=B[1].X; new(BatchedLines) FBatchedLine(TM.TransformPosition(P), TM.TransformPosition(Q), Color, DefaultLifeTime, 0.0f, DepthPriorityGroup); P.Z=B[ai].Z; Q.Z=B[ai].Z; P.X=B[aj].X; Q.X=B[aj].X; P.Y=B[0].Y; Q.Y=B[1].Y; new(BatchedLines) FBatchedLine(TM.TransformPosition(P), TM.TransformPosition(Q), Color, DefaultLifeTime, 0.0f, DepthPriorityGroup); } // LineBatcher and PersistentLineBatcher components will be updated at the end of UWorld::Tick MarkRenderStateDirty(); }
void AViewManager::TurnOnOutlineRendering() { PostProcessVolume->bEnabled = true; for (TObjectIterator<AActor> Itr; Itr; ++Itr) { auto CurrentObject = *Itr; bool FoundOutlineObject = false; for (auto OutlineObject : PlanElements) { if (OutlineObject == CurrentObject) { FoundOutlineObject = true; } } if (!FoundOutlineObject) { CurrentObject->SetActorHiddenInGame(true); } } for (auto OutlineObject : PlanElements) { if (OutlineObject) { OutlineObject->SetActorHiddenInGame(false); auto RenderComponent = OutlineObject->GetRootPrimitiveComponent(); if (RenderComponent) { RenderComponent->bRenderCustomDepth = true; RenderComponent->bRenderInMainPass = false; RenderComponent->MarkRenderStateDirty(); } } } }
void ULineBatchComponent::ApplyWorldOffset(const FVector& InOffset, bool bWorldShift) { Super::ApplyWorldOffset(InOffset, bWorldShift); bool bDirty = false; for (FBatchedLine& Line : BatchedLines) { Line.Start += InOffset; Line.End += InOffset; bDirty = true; } for (FBatchedPoint& Point : BatchedPoints) { Point.Position += InOffset; bDirty = true; } for (FBatchedMesh& Mesh : BatchedMeshes) { for (FVector& Vert : Mesh.MeshVerts) { Vert += InOffset; bDirty = true; } } if (bDirty) { MarkRenderStateDirty(); } }
bool UPaperGroupedSpriteComponent::RemoveInstance(int32 InstanceIndex) { if (!PerInstanceSpriteData.IsValidIndex(InstanceIndex)) { return false; } // Request navigation update UNavigationSystem::UpdateNavOctree(this); // remove instance PerInstanceSpriteData.RemoveAt(InstanceIndex); // update the physics state if (bPhysicsStateCreated) { // TODO: it may be possible to instead just update the BodyInstanceIndex for all bodies after the removed instance. ClearAllInstanceBodies(); CreateAllInstanceBodies(); } // Indicate we need to update render state to reflect changes MarkRenderStateDirty(); return true; }
void ULineBatchComponent::DrawLines(const TArray<FBatchedLine>& InLines) { BatchedLines.Append(InLines); // LineBatcher and PersistentLineBatcher components will be updated at the end of UWorld::Tick MarkRenderStateDirty(); }
void AViewManager::TurnOffOutlineRendering() { PostProcessVolume->bEnabled = false; for (TObjectIterator<AActor> Itr; Itr; ++Itr) { auto CurrentObject = *Itr; if (CurrentObject) { CurrentObject->SetActorHiddenInGame(false); } } for (auto OutlineObject : PlanElements) { if (OutlineObject) { OutlineObject->SetActorHiddenInGame(false); auto RenderComponent = OutlineObject->GetRootPrimitiveComponent(); if (RenderComponent) { RenderComponent->bRenderCustomDepth = false; RenderComponent->bRenderInMainPass = true; RenderComponent->MarkRenderStateDirty(); } } } CameraSwitchToStandardPerspective(); }
/** Invalidates the light's cached lighting with the option to recreate the light Guids. */ void ULightComponent::InvalidateLightingCacheInner(bool bRecreateLightGuids) { // Save the light state for transactions. Modify(); // Detach the component from the scene for the duration of this function. FComponentReregisterContext ReregisterContext(this); // Block until the RT processes the unregister before modifying variables that it may need to access FlushRenderingCommands(); StaticShadowDepthMap.Empty(); BeginReleaseResource(&StaticShadowDepthMap); bPrecomputedLightingIsValid = false; if (bRecreateLightGuids) { // Create new guids for light. UpdateLightGUIDs(); } else { ValidateLightGUIDs(); ShadowMapChannel = INDEX_NONE; } // Send to render thread MarkRenderStateDirty(); }
void ULineBatchComponent::DrawLine(const FVector& Start, const FVector& End, const FLinearColor& Color, uint8 DepthPriority, const float Thickness, const float LifeTime) { new(BatchedLines) FBatchedLine(Start, End, Color, LifeTime, Thickness, DepthPriority); // LineBatcher and PersistentLineBatcher components will be updated at the end of UWorld::Tick MarkRenderStateDirty(); }
void UExponentialHeightFogComponent::SetDirectionalInscatteringExponent(float Value) { if(DirectionalInscatteringExponent != Value) { DirectionalInscatteringExponent = Value; MarkRenderStateDirty(); } }
void UExponentialHeightFogComponent::SetFogInscatteringColor(FLinearColor Value) { if(FogInscatteringColor != Value) { FogInscatteringColor = Value; MarkRenderStateDirty(); } }
void UExponentialHeightFogComponent::SetFogDensity(float Value) { if(FogDensity != Value) { FogDensity = Value; MarkRenderStateDirty(); } }
void UExponentialHeightFogComponent::SetStartDistance(float Value) { if(StartDistance != Value) { StartDistance = Value; MarkRenderStateDirty(); } }
void UExponentialHeightFogComponent::SetFogHeightFalloff(float Value) { if(FogHeightFalloff != Value) { FogHeightFalloff = Value; MarkRenderStateDirty(); } }
void ULightComponent::SetMaterial(int32 ElementIndex, UMaterialInterface* InMaterial) { if (ElementIndex == 0) { LightFunctionMaterial = InMaterial; MarkRenderStateDirty(); } }
void UBillboardComponent::SetUV(int32 NewU, int32 NewUL, int32 NewV, int32 NewVL) { U = NewU; UL = NewUL; V = NewV; VL = NewVL; MarkRenderStateDirty(); }
void ULightComponent::SetIESTexture(UTextureLightProfile* NewValue) { if (AreDynamicDataChangesAllowed() && IESTexture != NewValue) { IESTexture = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetBloomThreshold(float NewValue) { if (AreDynamicDataChangesAllowed() && BloomThreshold != NewValue) { BloomThreshold = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetBloomTint(FColor NewValue) { if (AreDynamicDataChangesAllowed() && BloomTint != NewValue) { BloomTint = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetEnableLightShaftBloom(bool bNewValue) { if (AreDynamicDataChangesAllowed() && bEnableLightShaftBloom != bNewValue) { bEnableLightShaftBloom = bNewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetAffectTranslucentLighting(bool bNewValue) { if (AreDynamicDataChangesAllowed() && bAffectTranslucentLighting != bNewValue) { bAffectTranslucentLighting = bNewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetLightFunctionDisabledBrightness(float NewValue) { if (AreDynamicDataChangesAllowed() && NewValue != DisabledBrightness) { DisabledBrightness = NewValue; MarkRenderStateDirty(); } }
void ULightComponent::SetLightFunctionFadeDistance(float NewLightFunctionFadeDistance) { if (AreDynamicDataChangesAllowed() && NewLightFunctionFadeDistance != LightFunctionFadeDistance) { LightFunctionFadeDistance = NewLightFunctionFadeDistance; MarkRenderStateDirty(); } }
void ULightComponent::SetLightFunctionScale(FVector NewLightFunctionScale) { if (AreDynamicDataChangesAllowed() && NewLightFunctionScale != LightFunctionScale) { LightFunctionScale = NewLightFunctionScale; MarkRenderStateDirty(); } }
void USpotLightComponent::SetOuterConeAngle(float NewOuterConeAngle) { if (AreDynamicDataChangesAllowed(false) && NewOuterConeAngle != OuterConeAngle) { OuterConeAngle = NewOuterConeAngle; MarkRenderStateDirty(); } }
void ULightComponentBase::SetCastShadows(bool bNewValue) { if (AreDynamicDataChangesAllowed() && CastShadows != bNewValue) { CastShadows = bNewValue; MarkRenderStateDirty(); } }