π½οΈ 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
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β
Type | Name | Default | Description |
---|---|---|---|
Vector | location | Vector(0, 0, 0) | Location |
Rotator | rotation | Rotator(0, 0, 0) | Rotation |
number | width | 128 | Width of the generated Texture |
number | height | 128 | Height of the generated Texture |
number | render_rate | 0.033 | Render Rate (how frequent is the capture) |
number | view_distance | 5000 | Maximum distance of capturing |
number | fov_angle | 90 | FOV |
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
Returns | Name | Description | |
---|---|---|---|
AddImpulse | Applies a Force in world space to this Actor | ||
AttachTo | Attaches this Actor to another Actor | ||
Destroy | Destroys this Actor | ||
Detach | Detaches this Actor if attached | ||
SetCollision | Sets this Actor's collision type | ||
SetForce | Adds a permanent force to this Actor | ||
SetGravityEnabled | Sets whether gravity is enabled on this Actor | ||
![]() | SetVisibility | Sets the Actor visibility | |
SetHighlightEnabled | Sets whether the highlight is enabled on this Actor, and which highlight index to use | ||
SetOutlineEnabled | Sets whether the outline is enabled on this Actor, and which outline index to use | ||
SetLifeSpan | Sets the time (in seconds) before this Actor is destroyed | ||
SetLocation | Sets this Actor's location in the game world | ||
SetNetworkAuthority | Sets the Player this Actor will have its physics calculated on Network Authority | ||
SetRelativeLocation | Sets this Actor's relative location in local space | ||
SetRelativeRotation | Sets this Actor's relative rotation in local space | ||
SetRotation | Sets this Actor's rotation in the game world | ||
SetScale | Sets this Actor's scale | ||
![]() | SetValue | Sets a value in this Actor, which can be accessed by any package | |
TranslateTo | Smoothly moves this Actor to the specified location | ||
RotateTo | Smoothly rotates this Actor to the specified angle | ||
boolean | HasNetworkAuthority | Gets if the LocalPlayer is currently the Network Authority of this Actor | |
boolean | HasAuthority | Gets if this Actor was spawned by the client side | |
![]() | boolean | IsBeingDestroyed | Gets if this Actor is being destroyed |
![]() | boolean | IsGravityEnabled | Gets whether gravity is enabled on this Actor |
![]() | boolean | IsVisible | Gets whether this actor is Visible or not |
![]() | boolean | IsInWater | Gets if this Actor is in water |
![]() | boolean | IsNetworkDistributed | Gets if this Actor is currently Network Distributed |
![]() | boolean | IsValid | Returns if this Actor is valid (i.e. not destroyed) |
![]() | table | GetAttachedEntities | Gets all Actors attached to this Actor |
![]() | any | GetAttachedTo | Gets the Actor this Actor is attached to |
table | GetBounds | Gets this Actor's bounds | |
![]() | number | GetCollision | Gets this Actor's collision type |
![]() | number | GetID | Gets the universal network ID of this Actor |
![]() | Vector | GetLocation | Gets this Actor's location in the game world |
![]() | Rotator | GetRotation | Gets this Actor's angle in the game world |
![]() | Vector | GetForce | Gets this Actor's scale |
![]() | Vector | GetScale | Gets this Actor's scale |
![]() | string | GetType | Gets the type of this Actor |
![]() | any | GetValue | Gets a value stored on this Actor at the given key |
![]() | Vector | GetVelocity | Returns this Actor's current velocity |
string | AddActorTag | Adds an Unreal Actor Tag to this Actor | |
string | RemoveActorTag` | Remove an Unreal Actor Tag from this Actor | |
table | GetActorTags | Gets all Unreal Actor Tags from this Actor | |
![]() | function | Subscribe | Subscribes to an Event |
![]() | Unsubscribe | Unsubscribes from an Event |
Returns | Name | Description |
---|---|---|
SetFreeze | Stops or Restore Capturing | |
SetFOVAngle | Sets the FOV | |
Resize | Change the output Texture size | |
SetRenderRate | Set how frequent is the capture |
SetFreeze
β
Stops or Restore Capturing
scene_capture:SetFreeze(freeze)
Type | Parameter | Default Value | Description |
---|---|---|---|
boolean | freeze |
SetFOVAngle
β
Sets the FOV
scene_capture:SetFOVAngle(angle)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | angle |
Resize
β
Change the output Texture size
Too high texture will make the capture slower and will affect game performance
scene_capture:Resize(width, height)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | width | ||
number | height |
SetRenderRate
β
Set how frequent is the capture
Setting to 0 will make it capture every frame
scene_capture:SetRenderRate(render_rate)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | render_rate |
Eventsβ
Inherited Actor Events
Name | Description | |
---|---|---|
Destroy | Triggered when an Actor is destroyed | |
Spawn | Triggered when an Actor is spawned/created | |
ValueChange | Triggered when an Actor has a value changed with :SetValue() |