SPostFX
ClientScene
On this classCreateCommandBuffer
Members 17
| Function | CreateCommandBuffer | Return a new CommandBuffer. |
| Function | AddCommandBufferToCamera | Add the CommandBuffer to the Main Camera. |
| Function | RemoveCommandBufferFromCamera | Remove the CommandBuffer from the Main Camera. |
| Function | SetPostProfile | Set a custom Space Post-Processing Profile. |
| Function | ClearPostProfile | Clear current Post-Processing profile and restore default one. |
| Function | SetCrepsecularRays | – |
| Function | SetAmbientOcclusion | – |
| Function | SetMotionBlur | – |
| Function | SetBloom | – |
| Function | SetAnamorphicFlares | – |
| Function | SetVignette | – |
| Function | SetLensDirt | – |
| Function | SetChromaticAberrationPost | – |
| Function | SetFocus | – |
| Function | SupressFocus | – |
| Function | RestoreFocus | – |
| Function | SetLookUpTable | – |
Functions
CreateCommandBuffer
Return a new CommandBuffer.
Returns
SCommandBuffer
Example
Lua
commandBuffer = Space.PostFX.CreateCommandBuffer()
Lua
local commandbuffer=Space.PostFX.CreateCommandBuffer()
local mat=Space.Resources[1]
local cube=Space.Host.GetReference("Cube")
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
AddCommandBufferToCamera
Add the CommandBuffer to the Main Camera.
Parameters
| Name | Type | Default |
|---|---|---|
| commandbuffer | SCommandBuffer | – |
| cameraEvent | int | 19 |
Returns
void
Example
Lua
Space.PostFX.AddCommandBufferToCamera(ACommandBuffer)
---or
Space.PostFX.AddCommandBufferToCamera(ACommandBuffer, 18)
Lua
local commandbuffer=Space.PostFX.CreateCommandBuffer()
local mat=Space.Resources[1]
local cube=Space.Host.GetReference("Cube")
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
function RemoveCommandBuffer()
--Bind this function to a button and then click it in playing.
Space.PostFX.RemoveCommandBufferFromCamera(commandbuffer)
end
RemoveCommandBufferFromCamera
Remove the CommandBuffer from the Main Camera.
Parameters
| Name | Type | Default |
|---|---|---|
| commandbuffer | SCommandBuffer | – |
| cameraEvent | int | 19 |
Returns
void
Example
Lua
Space.PostFX.RemoveCommandBufferToCamera(ACommandBuffer)
---or
Space.PostFX.RemoveCommandBufferToCamera(ACommandBuffer, 18)
Lua
local commandbuffer=Space.PostFX.CreateCommandBuffer()
local mat=Space.Resources[1]
local cube=Space.Host.GetReference("Cube")
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
function RemoveCommandBuffer()
--Bind this function to a button and then click it in playing.
Space.PostFX.RemoveCommandBufferFromCamera(commandbuffer)
end
SetPostProfile
Set a custom Space Post-Processing Profile.
Parameters
| Name | Type | Default |
|---|---|---|
| customProfile | SResource | – |
Returns
void
Example
Lua
Space.PostFX.SetPostProfile(Space.Resources[1])
ClearPostProfile
void ClearPostProfile()
Clear current Post-Processing profile and restore default one.
Returns
void
Example
Lua
Space.PostFX.ClearPostProfile()
SetCrepsecularRays
void SetCrepsecularRays(bool on, float thresR, float thresG, float thresB, float colorR, float colorG, float colorB, float falloff, float blurSize, int blurIterations, float intensity)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| thresR | float | – |
| thresG | float | – |
| thresB | float | – |
| colorR | float | – |
| colorG | float | – |
| colorB | float | – |
| falloff | float | – |
| blurSize | float | – |
| blurIterations | int | – |
| intensity | float | – |
Returns
void
Example
Lua
Space.PostFX.SetCrepsecularRays(true, 255.0, 0.0, 0.0, 0.0,0.0, 255.0, 1.0, 1.0, 2, 4.0)
SetAmbientOcclusion
void SetAmbientOcclusion(bool on, float intensity, bool aoOnly)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| intensity | float | – |
| aoOnly | bool | – |
Returns
void
Example
Lua
Space.PostFX.SetAmbientOcclusion(true, 4.0, true)
SetMotionBlur
void SetMotionBlur(bool on, float shutterAngle)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| shutterAngle | float | – |
Returns
void
Example
Lua
Space.PostFX.SetMotionBlur(true, 20.0)
SetBloom
void SetBloom(bool on, float threshold, float intensity)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| threshold | float | – |
| intensity | float | – |
Returns
void
Example
Lua
Space.PostFX.SetBloom(true, 2.0, 4.0)
SetAnamorphicFlares
void SetAnamorphicFlares(bool on, float r, float g, float b, float intensity, float threshold, float spread, bool vertical)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| r | float | – |
| g | float | – |
| b | float | – |
| intensity | float | – |
| threshold | float | – |
| spread | float | – |
| vertical | bool | – |
Returns
void
Example
Lua
Space.PostFX.SetBloom(true, 255.0, 0.0, 0.0, 4.0, 2.0, 3.0, true)
SetVignette
void SetVignette(bool on, float r, float g, float b, float intensity)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| r | float | – |
| g | float | – |
| b | float | – |
| intensity | float | – |
Returns
void
Example
Lua
Space.PostFX.SetVignette(true, 255.0, 0.0, 0.0, 4.0)
SetLensDirt
void SetLensDirt(bool on, float threshold, SResource texture, float intensity)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| threshold | float | – |
| texture | SResource | – |
| intensity | float | – |
Returns
void
Example
Lua
Space.PostFX.SetLensDirt(true, 4.0, Space.Resources[1], 4.0)
SetChromaticAberrationPost
void SetChromaticAberrationPost(bool on, float strength, float cornerBlur)
Parameters
| Name | Type | Default |
|---|---|---|
| on | bool | – |
| strength | float | – |
| cornerBlur | float | – |
Returns
void
Example
Lua
Space.PostFX.SetChromaticAberrationPost(true, 4.0, 1.0)
SetFocus
Parameters
| Name | Type | Default |
|---|---|---|
| target | SGameObject | – |
Returns
void
Example
Lua
Space.PostFX.SetFocus(Space.Host.ExecutingObject)
SupressFocus
void SupressFocus()
Returns
void
Example
Lua
Space.PostFX.SupressFocus()
RestoreFocus
void RestoreFocus()
Returns
void
Example
Lua
Space.PostFX.RestoreFocus()
SetLookUpTable
Parameters
| Name | Type | Default |
|---|---|---|
| lut | SResource | – |
Returns
void
Example
Lua
Space.PostFX.SetLookUpTable(Space.Resources[1])



