AddPostProcessMaterial: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|Adds a post process material to the global post process volume. The material itself must be loaded with in a pak file. How to..."
 
28days (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 31: Line 31:


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

Latest revision as of 19:04, 18 November 2019

AddPostProcessMaterial

Type: Function
Context: Client
Introduced: v1.0

Description

Adds a post process material to the global post process volume. The material itself must be loaded with in a pak file.

How to create Post Process Materials: https://docs.unrealengine.com/en-US/Engine/Rendering/PostProcessEffects/PostProcessMaterials/index.html

Syntax

AddPostProcessMaterial(SlotName, UMaterialInterface)

Parameters

  • SlotName
    A name of your choice. This can be anything and is used so you can remove the material again with RemovePostProcessMaterial.
  • UMaterialInterface
    The material asset. Load it with UMaterialInterface.LoadFromAsset()

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