Создание полноэкранного эффекта с помощью потокового графа

Материал из CryWiki Russia

Версия от 15:25, 23 мая 2011; Alex626 (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Содержание

Making Full Screen Effect with Flow Graph

Basics

It is possible to use the flowgraph functionality to create full screen effects. This document is aimed to explain the nodes and functions to making these effects.

Show Additional Nodes

By default, the nodes for effect can not be seen in Flow Graph. To see them, go to the Flow Graph menu View/Components/WorkInProgress and check it on.

Add New Node

To add a new node on Flow Graph , Right Click any space in the main window, then go to Add Node , then select the node you want.

Delete Nodes

To delete nodes, select nodes and then press delete.

Connect Nodes

To connect or disconnect nodes, drag and drop the arrows among the nodes.

Copy and Paste

You can copy and paste multiple nodes at once by select nodes and right click/copy, paste.

Nodes for Effects

Camera Nodes

Found in Add Node > Camera . These nodes can make camera effects.

  • ViewShake: Generate random shake animation of the camera. It is effective to connect with explosive effects.
  • Trigger: Triggers effect.
  • Restrict: Select a condition for the ViewShake. This can be set to "None"" for no condition, "NoVehicle" if the shake should be applied only if the player is not in a vehicle, or "VehicleOnly" if the effect should be applied only if the player is inside a vehicle.
  • View: Selects camera to apply effect. Can be "FirstPerson"; for the Player, or ";Current" if you want to apply a ViewShake for a trackview sequence for example.
  • GroundOnly: When it's on, only apply the shake when the player is standing on the ground.
  • Angle: Controls the angle of the camera shake movement.
  • Shift: Controls the shift distance of the camera shake movement.
  • Duration: Controls duration from start to end of the effect.
  • Frequency: Controls frequency of the shake movement.
  • Randomness: Controls the randomness of the shake movement.

CrysisFX nodes


[Depreciated - use Image nodes instead]

Image nodes

This can be found in Add Node/Image . Image nodes are used to expose post process effects that can be used for gameplay or cutscenes purposes.

Important note: Multiple nodes can be used at same time to mix their results for different effects, but be aware that each of these nodes adds an extra rendering pass over the screen, so make sure to limit amount of nodes usage at same time to a reasonable amount. Most gpu expensive effects are marked with an *expensive note on them on this document.

ColorCorrection Sets the final image color changes for gameplay/cutscenes. For final image color grading use the “Time of Day” controls instead.

  • Enabled: Enables / Disables node.
  • Cyan: Controls Cyan value of the whole screen.
  • Magenta: Controls Magenta value of the whole screen.
  • Yellow: Controls Yellow value of the whole screen.
  • Luminance: Controls Luminance of the whole screen.
  • Brightness: Controls Brightness of the whole screen.
  • Contrast: Controls Contrast of the whole screen.
  • Saturation: Controls Saturation of the whole screen.
  • Hue: Hue of the whole screen.

DepthOfField (*expensive) Simulates camera depth of field.

  • Enabled: Enables / Disables node.
  • EnableDof: Enables / Disables effect.
  • FocusDistance: Controls focus distance of the camera.
  • FocusRange: Controls focus range of the camera
  • BlurAmount: Controls intensity of the blur effect.

FilterBlur Applies blur filter to screen.

  • Enabled: Enables / Disables node.
  • Type: Selects type of the filter (only 1 type supported at the moment).
  • Amount: Controls intensity of the effect. 0 disables.

FilterRadialBlur Applies radial blur effect to screen.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables
  • ScreenPosX,Y: Screen space position of radial center
  • BluringRadius: Radial distance attenuation

FilterGrain Applies grain filter to screen.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 Disables

FilterSharpen Applies an unsharp mask to the whole screen.

  • Enabled: Enables / Disables node.
  • Type: Selects type of the filter (only 1 type at the moment).
  • Amount: Controls intensity of the effect. 1 disables, values bellow 1 blur screen, above 1 sharpen screen.

DirectionalBlur Applies directional blur effect to the whole screen. Can be used for example for hit effects. Depends on motion blur, if it is enabled.

  • Enabled: Enables / Disables node.
  • Direction: Controls direction vector.

ChromaShift Applies chroma dispersion (multiple RBG sampling instead of single sample) effect to the whole screen.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables

EffectWaterDroplets Game specific effect, applies water flowing over the screen. This was made to be used when camera comes out of a water volume and is usually done automatically by the game engine.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables

EffectWaterFlow Another game specific effect, applies water flowing through screen. This was made to be used when camera is receiving any kind of water flow (e.g.: sprinkles, waterfalls). Should be used subtly.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables

AlienInterference Specially designed to generate alien noise/interference effect, when the player gets close to a specific source.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables

DistantRain Game specific effect, renders multiple volumetric layers at distance. Should be used in conjunction with some rain particles as a mean to decrease amount of particles required.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables
  • Speed: Controls rain shift speed
  • DistanceScale: Set how far rain layers are.
  • Color: Set rain layers color multiplier.

EffectBloodSplats Game specific effect, renders blood splats onscreen.

  • Enabled: Enables / Disables node.
  • Type: Selects type of the blood splat. 0 is human, 1 is alien
  • Amount: Controls intensity of the effect. 0 disables
  • Spawn: Enable when wanting to spawn blood (but disable after spawning).

EffectCondensation Game specific effect, simulates condensation on screen.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables.
  • CenterAmount: Control the visibility amount of effect at the center of screen.

EffectFrost Game specific effect, simulates frost accumulation on screen.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables
  • CenterAmount: Control the visibility amount of effect at the center of screen.

RainDrops Game specific effect, simulates rain drops falling on screen.

  • Enabled: Enables / Disables node.
  • Amount: Multiplier to amount of rain drops visible on screen. 0 disables
  • Spawn Time Distance: Time between another drop spawning.
  • Size: Rain drop size.
  • Size Variation: Rain drop size variation.

VolumetricScattering Game specific effect, simulates nearby volumetric foggy environment.

  • Enabled: Enables / Disables node.
  • Amount: Controls intensity of the effect. 0 disables
  • Tiling: Sets effect tile amount.
  • Speed: Sets effect animation speed.
  • Color: Color multiplier.
  • Type: only one type supported at the moment.

MaterialFX nodes

To implement full screen effect to the particle effect, its flow graph has to use these nodes. Found in Add Node/MaterialFX .


HUDstartFX

Decline the start of the full screen effect to the engine.

Input Port

  • Start: Triggered automatically by the MaterialEffects systems

Output Ports

  • Started: Triggered when the effect is started
  • Distance: Distance to player
  • Param1-4: Custom float parameters which can be set in the XML description of the effect


HUDEndFX

Decline the end of a full screen effect to the engine.

  • Trigger: Trigger this port when the effect is finished. This MUST be done to notify that the effect can be re-used again.

Implement full screen effect to the game To implement a full screen effect into the game, you have to save Flow Graph and call it in game.

  • Make an Effect";s Flow Graph.
  • Make a HUDstartFX and HUDendFX node.
  • Make a Delay node ( Add Node/Time/Delay ).
  • Set the Delay value to minimum required duration to involve whole duration of the effect Flow Graph.
  • Connect the Started of the HUDstartFX to every starting point of every effect node, and the In port of the tweaked Delay node.
  • Connect the Out of Delay node to the Trigger of the HUDendFX node.
  • Save the Flow Graph in Libs/MaterialEffects/Flowgraphs .
  • If you use full screen effect as an impact effect of the bullet or explosion, implement saved xml file";s name to /Effect/FlowGraph/name line of the appropriate effect, in Libs/MaterialEffects/FXLibs/bulletimpacts.xml . This xml authorizes the required elements of the effect, such as particle effect, sound, bullet decal.

Examples

To actually make full screen effect Flow Graph, you have to use some more general nodes. Here are some examples.

Adjust timing, animate value

This is an example Flow Graph of the impact effect of nuclear weapon.

Sandbox FullscreenEffects image001.jpg

  • Use a HUDstartFX and a HUDendFX node, connected to a Delay node, so the effect lasts the whole duration of the Flow Graph.
  • Use a Delay node just previous of the every effect nodes. This node is often used to adjust each node";s activation timing.
  • Use a Float node ( Add Node/Interpol/Float ) to animate some values of Color Correction . It can set Time , StartValue and EndValue . When it gets input, it interpolates value between StartValue to EndValue in the duration of Time , and then gives output value to the next node. This is useful way to make animated values.
  • Some nodes getting same output value from the same node. Usually, output value can connect to multiple inputs. This is the good point to decrease amount number of the nodes.

Fade in textures on screen

This is an example Flow Graph of the dirt effect on the screen, when player was near to explosion.

Sandbox FullscreenEffects image002.jpg

  • Use a RandomSelect node ( Add Node/Logic/RandomSelect ) to randomly pick a texture from the three available.
  • Use a ScreenFader node to fade in each texture. This node was originally designed for fade out whole screen. Using this method, you can pop up textures, and then fade them out after few seconds.
  • Pop up texture: When gets input, ScreenFader node starts fade out whole screen and starts display texture, in duration of FadeOutTime . In this case, FadeOutTime is set to 0, so the texture pops up immediately.
  • Delay the fade in: FadeIn is delayed 4 second by the Delay node, so texture remains on the screen for the while. 4 seconds later, whole screen starts fade in, in duration of the FadeInTime value. Then it seems texture is fading out in 3 seconds duration.
  • Use an Any node ( Add Node/Logic/Any ), to gather the output textures and pick up the one to display.

See Also