UActorComponent::MarkRenderStateDirty
#include "Components/ActorComponent.h"
Access: public
Description
Marks this component's render state dirty so the scene proxy is fully recreated or updated at the end of the frame. Use this whenever a property change affects the proxy's construction data.
Caveats & Gotchas
- • Triggers a full proxy recreation, which is expensive. If only dynamic per-frame data changed (e.g. a color tint that updates via SendRenderDynamicData_Concurrent), use MarkRenderDynamicDataDirty instead to avoid unnecessary rebuilds.
- • Calling this every tick on many components will cause severe performance degradation. Cache dirty state or use property change callbacks to call it only when values actually change.
- • There is a static multicast delegate MarkRenderStateDirtyEvent you can subscribe to for observing when any component marks itself dirty — useful for editor tooling.
Signature
ENGINE_API void MarkRenderStateDirty() Return Type
void Example
Forcing a render state refresh after changing a property C++
void UMyMeshComponent::SetCustomColor(FLinearColor NewColor)
{
if (CustomColor != NewColor)
{
CustomColor = NewColor;
MarkRenderStateDirty(); // Rebuild the scene proxy with the new color
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?