Skip to main content
Version: latest - a1.7.0 βš–οΈ

πŸ“½οΈ SceneCapture

Scene Capture is an Actor which captures a fully dynamic image of the scene into a Texture. It captures the scene from its view frustum, stores that view as an image, which is then used within a Material.

info

🟧 Authority: This class can only be spawned on Client.

⏬ Inheritance: This class inherits from Actor.

Usage​

-- Client Side
local scene_capture = SceneCapture(
Vector(-900, 185, 215),
Rotator(0, 90, 90),
256,
256,
0.033,
5000,
100
)

my_prop:SetMaterialFromSceneCapture(scene_capture)
tip

You can use the output Texture from a SceneCapture with :SetMaterialFromSceneCapture() method!

Constructor Parameters​

TypeNameDefaultDescription
VectorlocationVector(0, 0, 0)Location
RotatorrotationRotator(0, 0, 0)Rotation
numberwidth128Width of the generated Texture
numberheight128Height of the generated Texture
numberrender_rate0.033Render Rate (how frequent is the capture)
numberview_distance5000Maximum distance of capturing
numberfov_angle90FOV
note

Scene Captures capture a scene in real time, this means every tick it will re-render the scene from scratch. Please consider reducing the width/height and even the render_rate to improve it's performance.

We've worked hard to make SceneCapture as performatic as possible! Some techniques were applied for optimization and reducing the render_rate automatically when you are far and when the generated texture is out of the screen.

Functions​

Inherited Actor Functions
ReturnsNameDescription
AddImpulseApplies a Force in world space to this Actor
AttachToAttaches this Actor to another Actor
DestroyDestroys this Actor
DetachDetaches this Actor if attached
SetCollisionSets this Actor's collision type
SetForceAdds a permanent force to this Actor
SetGravityEnabledSets whether gravity is enabled on this Actor
SetVisibilitySets the Actor visibility
SetHighlightEnabledSets whether the highlight is enabled on this Actor, and which highlight index to use
SetOutlineEnabledSets whether the outline is enabled on this Actor, and which outline index to use
SetLifeSpanSets the time (in seconds) before this Actor is destroyed
SetLocationSets this Actor's location in the game world
SetNetworkAuthoritySets the Player this Actor will have its physics calculated on Network Authority
SetRelativeLocationSets this Actor's relative location in local space
SetRelativeRotationSets this Actor's relative rotation in local space
SetRotationSets this Actor's rotation in the game world
SetScaleSets this Actor's scale
SetValueSets a value in this Actor, which can be accessed by any package
TranslateToSmoothly moves this Actor to the specified location
RotateToSmoothly rotates this Actor to the specified angle
booleanHasNetworkAuthorityGets if the LocalPlayer is currently the Network Authority of this Actor
booleanHasAuthorityGets if this Actor was spawned by the client side
booleanIsBeingDestroyedGets if this Actor is being destroyed
booleanIsGravityEnabledGets whether gravity is enabled on this Actor
booleanIsVisibleGets whether this actor is Visible or not
booleanIsInWaterGets if this Actor is in water
booleanIsNetworkDistributedGets if this Actor is currently Network Distributed
booleanIsValidReturns if this Actor is valid (i.e. not destroyed)
tableGetAttachedEntitiesGets all Actors attached to this Actor
anyGetAttachedToGets the Actor this Actor is attached to
tableGetBoundsGets this Actor's bounds
numberGetCollisionGets this Actor's collision type
numberGetIDGets the universal network ID of this Actor
VectorGetLocationGets this Actor's location in the game world
RotatorGetRotationGets this Actor's angle in the game world
VectorGetForceGets this Actor's scale
VectorGetScaleGets this Actor's scale
stringGetTypeGets the type of this Actor
anyGetValueGets a value stored on this Actor at the given key
VectorGetVelocityReturns this Actor's current velocity
stringAddActorTagAdds an Unreal Actor Tag to this Actor
stringRemoveActorTag`Remove an Unreal Actor Tag from this Actor
tableGetActorTagsGets all Unreal Actor Tags from this Actor
functionSubscribeSubscribes to an Event
UnsubscribeUnsubscribes from an Event
ReturnsNameDescription
SetFreezeStops or Restore Capturing
SetFOVAngleSets the FOV
ResizeChange the output Texture size
SetRenderRateSet how frequent is the capture

SetFreeze​

Stops or Restore Capturing

scene_capture:SetFreeze(freeze)
TypeParameterDefault ValueDescription
booleanfreeze

SetFOVAngle​

Sets the FOV

scene_capture:SetFOVAngle(angle)
TypeParameterDefault ValueDescription
numberangle

Resize​

Change the output Texture size

Too high texture will make the capture slower and will affect game performance

scene_capture:Resize(width, height)
TypeParameterDefault ValueDescription
numberwidth
numberheight

SetRenderRate​

Set how frequent is the capture

Setting to 0 will make it capture every frame

scene_capture:SetRenderRate(render_rate)
TypeParameterDefault ValueDescription
numberrender_rate

Events​

Inherited Actor Events
NameDescription
DestroyTriggered when an Actor is destroyed
SpawnTriggered when an Actor is spawned/created
ValueChangeTriggered when an Actor has a value changed with :SetValue()