SPostFX
客户端场景
成员 17
| 函数 | CreateCommandBuffer | Return a new CommandBuffer. |
| 函数 | AddCommandBufferToCamera | Add the CommandBuffer to the Main Camera. |
| 函数 | RemoveCommandBufferFromCamera | Remove the CommandBuffer from the Main Camera. |
| 函数 | SetPostProfile | Set a custom Space Post-Processing Profile. |
| 函数 | ClearPostProfile | Clear current Post-Processing profile and restore default one. |
| 函数 | SetCrepsecularRays | – |
| 函数 | SetAmbientOcclusion | – |
| 函数 | SetMotionBlur | – |
| 函数 | SetBloom | – |
| 函数 | SetAnamorphicFlares | – |
| 函数 | SetVignette | – |
| 函数 | SetLensDirt | – |
| 函数 | SetChromaticAberrationPost | – |
| 函数 | SetFocus | – |
| 函数 | SupressFocus | – |
| 函数 | RestoreFocus | – |
| 函数 | SetLookUpTable | – |
函数
CreateCommandBuffer
Return a new CommandBuffer.
返回值
SCommandBuffer
示例
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.
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| commandbuffer | SCommandBuffer | – |
| cameraEvent | int | 19 |
返回值
void
示例
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.
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| commandbuffer | SCommandBuffer | – |
| cameraEvent | int | 19 |
返回值
void
示例
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.
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| customProfile | SResource | – |
返回值
void
示例
Lua
Space.PostFX.SetPostProfile(Space.Resources[1])
ClearPostProfile
void ClearPostProfile()
Clear current Post-Processing profile and restore default one.
返回值
void
示例
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)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| thresR | float | – |
| thresG | float | – |
| thresB | float | – |
| colorR | float | – |
| colorG | float | – |
| colorB | float | – |
| falloff | float | – |
| blurSize | float | – |
| blurIterations | int | – |
| intensity | float | – |
返回值
void
示例
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)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| intensity | float | – |
| aoOnly | bool | – |
返回值
void
示例
Lua
Space.PostFX.SetAmbientOcclusion(true, 4.0, true)
SetMotionBlur
void SetMotionBlur(bool on, float shutterAngle)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| shutterAngle | float | – |
返回值
void
示例
Lua
Space.PostFX.SetMotionBlur(true, 20.0)
SetBloom
void SetBloom(bool on, float threshold, float intensity)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| threshold | float | – |
| intensity | float | – |
返回值
void
示例
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)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| r | float | – |
| g | float | – |
| b | float | – |
| intensity | float | – |
| threshold | float | – |
| spread | float | – |
| vertical | bool | – |
返回值
void
示例
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)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| r | float | – |
| g | float | – |
| b | float | – |
| intensity | float | – |
返回值
void
示例
Lua
Space.PostFX.SetVignette(true, 255.0, 0.0, 0.0, 4.0)
SetLensDirt
void SetLensDirt(bool on, float threshold, SResource texture, float intensity)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| threshold | float | – |
| texture | SResource | – |
| intensity | float | – |
返回值
void
示例
Lua
Space.PostFX.SetLensDirt(true, 4.0, Space.Resources[1], 4.0)
SetChromaticAberrationPost
void SetChromaticAberrationPost(bool on, float strength, float cornerBlur)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| on | bool | – |
| strength | float | – |
| cornerBlur | float | – |
返回值
void
示例
Lua
Space.PostFX.SetChromaticAberrationPost(true, 4.0, 1.0)
SetFocus
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| target | SGameObject | – |
返回值
void
示例
Lua
Space.PostFX.SetFocus(Space.Host.ExecutingObject)
SupressFocus
void SupressFocus()
返回值
void
示例
Lua
Space.PostFX.SupressFocus()
RestoreFocus
void RestoreFocus()
返回值
void
示例
Lua
Space.PostFX.RestoreFocus()
SetLookUpTable
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| lut | SResource | – |
返回值
void
示例
Lua
Space.PostFX.SetLookUpTable(Space.Resources[1])



