wiki.sine.space | sinespace

Scripting/SPostFX

From wiki.sine.space
Revision as of 04:13, 31 December 2020 by Edisonwu (Talk | contribs) (Created page with "=Members= {{ScriptFunction|SCommandBuffer|CreateCommandBuffer|{float r, float g, float b, float a}|Return a new CommandBuffer.|5= local commandbuffer=Space.PostFX.CreateComman...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Members

CreateCommandBuffer

SCommandBuffer CreateCommandBuffer {float r, float g, float b, float a}

Return a new CommandBuffer.

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);

Add the CommandBuffer to the Main Camera.

--See CreateCommandBuffer


RemoveCommandBufferFromCamera

void RemoveCommandBufferFromCamera (SCommandBuffer commandbuffer);

Remove the CommandBuffer from the Main Camera.

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.

local file=Space.Resources[2]

--Create a Legacy/Space Post-processing profile.

Space.PostFX.SetPostProfile(file)


ClearPostProfile

void ClearPostProfile ();

Clear current Post-Processing profile and restore default one.

local file=Space.Resources[2]

--Create a Legacy/Space Post-processing profile.
Space.PostFX.SetPostProfile(file)

Space.PostFX.ClearPostProfile()