RemovePostProcessMaterial: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
28days (talk | contribs)
No edit summary
 
Line 27: Line 27:


{{RelatedFunctions}}
{{RelatedFunctions}}
* [[SetPostEffect]]
* [[AddPostProcessMaterial]]
* [[AddPostProcessMaterial]]
* [[RemovePostProcessMaterial]]
* [[RemovePostProcessMaterial]]

Latest revision as of 19:04, 18 November 2019

RemovePostProcessMaterial

Type: Function
Context: Client
Introduced: v1.0

Description

Removes a post process material that was previously added with AddPostProcessMaterial

Syntax

RemovePostProcessMaterial(SlotName)

Parameters

Return Value

  • Returns true on success.

Example

local added = false
function OnKeyPress(key)
    if key == "J" then
        added = not added
        if added then
            AddPostProcessMaterial("MyPPMaterial", UMaterialInterface.LoadFromAsset("/MyMod/Material/M_Cellshading"))
        else
            RemovePostProcessMaterial("MyPPMaterial")
        end
    end
end
AddEvent("OnKeyPress", OnKeyPress)

See also