wiki.sine.space | sinespace

Difference between revisions of "Scripting/SPostFX"

From wiki.sine.space
Jump to: navigation, search
(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...")
 
(Replaced content with "This page has moved to: https://docs.sine.space/v/scripting/client-scripting/scene/spostfx")
 
Line 1: Line 1:
=Members=
+
This page has moved to: https://docs.sine.space/v/scripting/client-scripting/scene/spostfx
{{ScriptFunction|SCommandBuffer|CreateCommandBuffer|{float r, float g, float b, float a}|Return a new CommandBuffer.|5=
+
local commandbuffer=Space.PostFX.CreateCommandBuffer()<br>
+
local mat=Space.Resources[1]<br>
+
local cube=Space.Host.GetReference("Cube")<br>
+
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)<br>
+
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
+
}}
+
 
+
{{ScriptFunction|void|AddCommandBufferToCamera|(SCommandBuffer commandbuffer);|Add the CommandBuffer to the Main Camera.|5=
+
''--See CreateCommandBuffer''
+
}}
+
 
+
{{ScriptFunction|void|RemoveCommandBufferFromCamera|(SCommandBuffer commandbuffer);|Remove the CommandBuffer from the Main Camera.|5=
+
local commandbuffer=Space.PostFX.CreateCommandBuffer()<br>
+
local mat=Space.Resources[1]<br>
+
local cube=Space.Host.GetReference("Cube")<br>
+
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)<br>
+
Space.PostFX.AddCommandBufferToCamera(commandbuffer)<br>
+
function RemoveCommandBuffer()<br>
+
''--Bind this function to a button and then click it in playing.''<br>
+
&nbsp;&nbsp;&nbsp;&nbsp;Space.PostFX.RemoveCommandBufferFromCamera(commandbuffer)<br>
+
end
+
}}
+
 
+
{{ScriptFunction|void|SetPostProfile|(SResource customProfile);|Set a custom Space Post-Processing Profile.|5=
+
local file=Space.Resources[2]<br>
+
''--Create a Legacy/Space Post-processing profile.''<br>
+
Space.PostFX.SetPostProfile(file)
+
}}
+
 
+
{{ScriptFunction|void|ClearPostProfile|();|Clear current Post-Processing profile and restore default one.|5=
+
local file=Space.Resources[2]<br>
+
''--Create a Legacy/Space Post-processing profile.''<br>
+
Space.PostFX.SetPostProfile(file)
+
Space.PostFX.ClearPostProfile()
+
}}
+
 
+
{{Scripting Navbox}}
+

Latest revision as of 07:14, 19 September 2022

This page has moved to: https://docs.sine.space/v/scripting/client-scripting/scene/spostfx