You can use the Flow Graph to create full screen effects. This section explains the nodes and functions for making these effects.
Make sure that the Advanced components are displayed in the Components list. You can set this option in the Flow Graph Editor's toolbar, under View -> Components.
You can find this option under context menu, Add Node -> Camera. These nodes can be used to make camera effects. For example, ViewShakeEx generates random shake animation of the camera. It is effective to connect with explosive effects.
You can find this option under context menu, Add Node -> Image. Image nodes are used to expose post process effects that can be used in a game play or for cut scenes purposes.
When using the image or camera nodes, it's not necessary to set an entity to the Image nodes; they will be automatically assigned to the local player. Even though most of the nodes have the enabled and disabled ports, it's safer to ignore the disabled input and use the enabled input and set it to be true or false. The inputs are also of the Boolean type and so it's always best to combine these nodes with the Math:BooleanTo node to be sure that the correct values are being sent to the image node.
Here is an example of a flow graph that turns on/off the rain drops full screen FX with input keys:
Pic1: A sample Flow Graph for rain drops effect.
For more information on Image nodes, please refer: Image Nodes
You can find this option under context menu, Add Node ->MaterialFX. You can use these nodes to implement full screen effect to the particle effect. These Material FX graphs, are called from the code.
For example:
Below is an example of the dirt_bullet_hit graph being called when the player shoots the ground with mat_grass assigned as a surface type.
<Effect name="bullet_grass" delay="0.05">
<Audio trigger="Play_p_pro_impact_bullet_hit_mat_grass">
</Audio>
<RandEffect name="particles1">
<Particle>
<Name minscale="0.3" maxscale="1" maxscaledist="80">bullet.hit_grass.a</Name>
</Particle>
<Particle>
<Name minscale="0.4" maxscale="1.3" maxscaledist="80">bullet.hit_grass.b</Name>
</Particle>
<Particle>
<Name minscale="0.6" maxscale="1.2" maxscaledist="80">bullet.hit_grass.c</Name>
</Particle>
</RandEffect>
<RandEffect>
<Decal minscale="0.04" maxscale="0.06">
<Material>materials/decals/dirt/ground</Material>
</Decal>
</RandEffect>
<FlowGraph name="dirt_bullet_hit" maxdist="2"/>
</Effect>
The Material FX graph must contain the Start & End nodes to operate correctly. The logic within these 2 nodes is down to you.
HUDstartFX
Start of the full screen effect to be applied in the engine.
Input Port
Output Ports
HUDEndFX
End of a full screen effect to the engine.
To implement a full screen effect into the game, you have to save the Flow Graph and call it in game. Make sure you set the following options in your Flow Graph:
Libs/MaterialEffects/Flowgraphs
./Effect/FlowGraph/name)
to match the appropriate effect in Libs/MaterialEffects/FXLibs/bulletimpacts.xml
. This xml file authorizes the required elements of the effect, such as particle effect, sound, or bullet decal.For making a full screen effect Flow Graph, you must use few extra general nodes. Here are some examples:
Adjust timing, animate value
Pic2: An example Flow Graph of the impact effect of nuclear weapon.
Pic3: An example Flow Graph of the dirt effect on the screen, when a player is at an explosion site.