Breakroom is now Sinewave Campus. Book a meeting

SPostFX

ClientScène
Dans cette classeCreateCommandBuffer
  1. Fonctions
  2. CreateCommandBuffer
  3. AddCommandBufferToCamera
  4. RemoveCommandBufferFromCamera
  5. SetPostProfile
  6. ClearPostProfile
  7. SetCrepsecularRays
  8. SetAmbientOcclusion
  9. SetMotionBlur
  10. SetBloom
  11. SetAnamorphicFlares
  12. SetVignette
  13. SetLensDirt
  14. SetChromaticAberrationPost
  15. SetFocus
  16. SupressFocus
  17. RestoreFocus
  18. SetLookUpTable
Membres 17
FonctionCreateCommandBufferReturn a new CommandBuffer.
FonctionAddCommandBufferToCameraAdd the CommandBuffer to the Main Camera.
FonctionRemoveCommandBufferFromCameraRemove the CommandBuffer from the Main Camera.
FonctionSetPostProfileSet a custom Space Post-Processing Profile.
FonctionClearPostProfileClear current Post-Processing profile and restore default one.
FonctionSetCrepsecularRays–
FonctionSetAmbientOcclusion–
FonctionSetMotionBlur–
FonctionSetBloom–
FonctionSetAnamorphicFlares–
FonctionSetVignette–
FonctionSetLensDirt–
FonctionSetChromaticAberrationPost–
FonctionSetFocus–
FonctionSupressFocus–
FonctionRestoreFocus–
FonctionSetLookUpTable–

Fonctions​

CreateCommandBuffer​

SCommandBuffer CreateCommandBuffer()

Return a new CommandBuffer.

Valeurs de retour

SCommandBuffer

Exemple

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​

void AddCommandBufferToCamera(SCommandBuffer commandbuffer, int cameraEvent = 19)

Add the CommandBuffer to the Main Camera.

Paramètres

NomTypeValeur par défaut
commandbufferSCommandBuffer–
cameraEventint19

Valeurs de retour

void

Exemple

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​

void RemoveCommandBufferFromCamera(SCommandBuffer commandbuffer, int cameraEvent = 19)

Remove the CommandBuffer from the Main Camera.

Paramètres

NomTypeValeur par défaut
commandbufferSCommandBuffer–
cameraEventint19

Valeurs de retour

void

Exemple

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​

void SetPostProfile(SResource customProfile)

Set a custom Space Post-Processing Profile.

Paramètres

NomTypeValeur par défaut
customProfileSResource–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetPostProfile(Space.Resources[1])

ClearPostProfile​

void ClearPostProfile()

Clear current Post-Processing profile and restore default one.

Valeurs de retour

void

Exemple

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)

Paramètres

NomTypeValeur par défaut
onbool–
thresRfloat–
thresGfloat–
thresBfloat–
colorRfloat–
colorGfloat–
colorBfloat–
fallofffloat–
blurSizefloat–
blurIterationsint–
intensityfloat–

Valeurs de retour

void

Exemple

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)

Paramètres

NomTypeValeur par défaut
onbool–
intensityfloat–
aoOnlybool–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetAmbientOcclusion(true, 4.0, true)

SetMotionBlur​

void SetMotionBlur(bool on, float shutterAngle)

Paramètres

NomTypeValeur par défaut
onbool–
shutterAnglefloat–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetMotionBlur(true, 20.0)

SetBloom​

void SetBloom(bool on, float threshold, float intensity)

Paramètres

NomTypeValeur par défaut
onbool–
thresholdfloat–
intensityfloat–

Valeurs de retour

void

Exemple

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)

Paramètres

NomTypeValeur par défaut
onbool–
rfloat–
gfloat–
bfloat–
intensityfloat–
thresholdfloat–
spreadfloat–
verticalbool–

Valeurs de retour

void

Exemple

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)

Paramètres

NomTypeValeur par défaut
onbool–
rfloat–
gfloat–
bfloat–
intensityfloat–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetVignette(true, 255.0, 0.0, 0.0, 4.0)

SetLensDirt​

void SetLensDirt(bool on, float threshold, SResource texture, float intensity)

Paramètres

NomTypeValeur par défaut
onbool–
thresholdfloat–
textureSResource–
intensityfloat–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetLensDirt(true, 4.0, Space.Resources[1], 4.0)

SetChromaticAberrationPost​

void SetChromaticAberrationPost(bool on, float strength, float cornerBlur)

Paramètres

NomTypeValeur par défaut
onbool–
strengthfloat–
cornerBlurfloat–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetChromaticAberrationPost(true, 4.0, 1.0)

SetFocus​

void SetFocus(SGameObject target)

Paramètres

NomTypeValeur par défaut
targetSGameObject–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetFocus(Space.Host.ExecutingObject)

SupressFocus​

void SupressFocus()

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SupressFocus()

RestoreFocus​

void RestoreFocus()

Valeurs de retour

void

Exemple

Lua
Space.PostFX.RestoreFocus()

SetLookUpTable​

void SetLookUpTable(SResource lut)

Paramètres

NomTypeValeur par défaut
lutSResource–

Valeurs de retour

void

Exemple

Lua
Space.PostFX.SetLookUpTable(Space.Resources[1])