Skip to content

Commit ae36330

Browse files
JordanL8Lewis JordaniTris666
authored andcommitted
Vfx/docs/bulk review continued (#78)
* Reviewed Contexts and terminology. * Began reviewing Events * Added sticky notes doc and reviewed Events * Update Contexts.md * Formatted documentation. * Update Contexts.md Co-authored-by: Lewis Jordan <lewisjordan@unity3d.com> Co-authored-by: Tristan Genevet <tristan@unity3d.com>
1 parent ccbf6a2 commit ae36330

File tree

9 files changed

+167
-115
lines changed

9 files changed

+167
-115
lines changed

com.unity.visualeffectgraph/Documentation~/ComponentAPI.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<div style="border: solid 1px #999; border-radius:12px; background-color:#EEE; padding: 8px; padding-left:14px; color: #555; font-size:14px;"><b>Draft:</b> The content on this page is complete, but it has not been reviewed yet.</div>
2-
31
# Visual Effect component API
42

53
To create an instance of a [Visual Effect Graph](VisualEffectGraphAsset.md) in a Scene, Unity uses the [Visual Effect component](VisualEffectComponent.md). The Visual Effect component attaches to GameObjects in your Scene and references a Visual Effect Graph which defines the visual effect. This allows you to create different instances of effects at various positions and orientations, and control each effect independently. To control an effect at runtime, Unity provides C# API that you can use to modify the Visual Effect component and set [Property](Properties.md) overrides.

com.unity.visualeffectgraph/Documentation~/Contexts.md

Lines changed: 81 additions & 76 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,62 @@
1-
<div style="border: solid 1px #999; border-radius:12px; background-color:#EEE; padding: 8px; padding-left:14px; color: #555; font-size:14px;"><b>Draft:</b> The content on this page is complete, but it has not been reviewed yet.</div>
21
# Events
32

4-
Events are the Processing Workflow inputs of a Visual Effect Graph. Through Events, a Visual Effect can :
3+
Events define the inputs for a Visual Effect Graph's [**processing** workflow](GraphLogicAndPhilosophy.md#processing-workflow-(vertical-logic)). The Spawn and Initialize [Contexts](Contexts.md) use Events as their inputs. Through Events, a Visual Effect Graph can :
54

6-
* Start and stop spawning particles,
7-
* Read Attribute payloads sent from C#
8-
9-
Events are used in the graph as inputs for Spawn Contexts and Initialize
5+
* Start and stop spawning particles.
6+
* Read [Event Attribute payloads](#eventattribute-payloads) sent from C# scripts.
107

118
## Creating Events
129

1310
![](Images/EventContexts.png)
1411

15-
You can Create Events using Event Contexts. These contexts have no Flow input and connect to Spawn or Initialize Contexts.
12+
In general, an Event is just a string that represents the Event's name. To receive an Event in the Visual Effect Graph, create an Event [Context](Contexts.md) and type the name of the Event you want to receive in the **Event Name** property. Event Contexts have no input flow slots and can only connect their output flow slot to Spawn or Initialize Contexts.
13+
14+
To create an Event Context:
1615

17-
In order to Create an Event Context, right click in an empty space of the Workspace and select Create Node, then Select **Event (Context)** from the Node Creation menu.
16+
1. In the [Visual Effect Graph window](VisualEffectGraphWindow.md), right-click in an empty space.
17+
2. From the menu, click **Create Node**.
18+
3. In the Node Creation menu, click **Contexts > Event (Context)**.
19+
4. In the **Event Name** input field, type the name of your Event.
1820

1921
## Default Events
2022

21-
Visual Effect Graphs provide two Default Events that are implicitly bound to the Start and Stop Flow Inputs of the Spawn Contexts:
23+
The Visual Effect Graph provide two default Events:
2224

23-
* `OnPlay` for the intent *Enabling the Spawn of Particles*, is implicitly bound to the Start Flow input of any Spawn Context.
24-
* `OnStop` for the intent of *Stopping the Spawn of Particles*, is implicitly bound to the Stop Flow input of any Spawn Context.
25+
* **OnPlay**: To enable the spawning of particles. If you do not assign an Event to a Spawn Context's **Start** input flow slot, the Visual Effect Graph implicitly binds this Event to that input flow slot instead.
26+
* **OnStop**: To disable the spawning of particles. If you do not assign an Event to a Spawn Context's **Stop** input flow slot, the Visual Effect Graph implicitly binds this Event to that input flow slot instead.
2527

26-
Connecting Event Contexts on the Start and Stop Flow inputs of a Spawn Contexts will remove the implicit binding to the `OnPlay` and `OnStop` Events
28+
If you connect an Event Context to a Spawn Context's **Start** or **Stop** input flow slot, this removes the implicit binding to the **OnPlay** and **OnStop** Events respectively.
2729

2830
## Custom Events
2931

30-
Custom Events can be created inside Visual Effect Graphs using Event Contexts.
32+
If you do not want to use the default Events, you can use an Event Context to create your own custom Event.
3133

32-
In order to create a custom event, create an event using the **Create Node** menu, then change its name in the **Event Name** field
34+
To do this, first [create an Event Context](#creating-events), then type the name of your custom Event in the **Event Name** property.
3335

34-
## EventAttribute Payloads
36+
## Event Attribute Payloads
3537

36-
Event Attribute payloads are attributes attached on one event. You can set these attributes in Visual Effect Graph using the **Set [Attribute] Event Attribute>** Blocks in Spawn Contexts, but you can also attach them to events sent from the scene using the [Component API](ComponentAPI.md#event-attributes) .
38+
Event Attribute payloads are attributes that you can attach to an Event. To set these attributes in a Visual Effect Graph, you can use the **Set [Attribute]** Blocks in Spawn Contexts, but you can also attach them to Events you send from C# scripts. For information on how to do that latter, see [Component API](ComponentAPI.md#event-attributes) .
3739

38-
EventAttribute Payloads are attributes that will implicitly travel through the graph from Events, through Spawn Systems, and that can be caught in Initialize Contexts using **Get Source Attribute Operators** and **Inherit [Attribute] Blocks**
40+
Event Attribute Payloads are attributes that implicitly travel through the graph from Events, through Spawn Contexts, and eventually to an Initialize Context. To catch a payload in an Initialize Context, use **Get Source Attribute** Operators or **Inherit [Attribute]** Blocks.
3941

40-
## Default VisualEffect Event
42+
## Default Visual Effect Event
4143

42-
The default Visual Effect Event defines the name of the event that is implicitly sent when a `Reset` is performed on a [Visual Effect](VisualEffectComponent.md) instance (this can happen at first start or any restart of the effect).
44+
The default Visual Effect Event defines the name of the Event that the Visual Effect Graph implicitly sends when a [Visual Effect](VisualEffectComponent.md) instance **Resets**. This happens when the effect first starts, or when the effect restarts.
4345

44-
Default VisualEffect Event is defined in the [Visual Effect Graph Asset Inspector](VisualEffectGraphAsset.md) but can be overridden in any [Visual Effect Inspector](VisualEffectComponent.md) for any instance in the scene.
46+
You can define the default Visual Effect Event for each [Visual Effect Graph Asset](VisualEffectGraphAsset.md) independently. You can also override this value for every instance of the Visual Effect Graph Asset. To override the default Visual Effect Event for an instance, see **Initial Event Name** in the [Visual Effect Inspector](VisualEffectComponent.md).
4547

4648
## GPU Events
4749

48-
GPU Events is an **Experimental feature** of Visual Effect Graph : It enables particle spawn based on other Particles. You can enable this option in [Visual Effect Preferences](VisualEffectPreferences.md) .
50+
GPU Events are an **Experimental feature** of the Visual Effect Graph. They allow you to spawn particles based on other particles. To enable this option, enable the **Experimental Operators/Blocks** checkbox in the [Visual Effect Preferences](VisualEffectPreferences.md) .
4951

50-
![](Images/GPUEvent.png)
52+
GPU Events are Event Contexts that rely on data sent from other systems, for example, when a particle dies. The following Update Blocks can send GPU Event Data:
5153

52-
GPU Events are Event Contexts that relies on Data sent from other Systems, for instance when a particle dies, or other conditions. The following Update Blocks can send GPU Event Data:
54+
* **Trigger Event On Die**: Spawns N Particles on another system when a particle dies.
55+
* **Trigger Event Rate**: Spawn N Particles per second (or per distance travelled), based on a particle from a system.
56+
* **Trigger Event Always**: Spawns N Particles every frame.
5357

54-
* **Trigger Event On Die** : Spawns N Particles on another system when a particle dies
55-
* **Trigger Event Rate** : Spawn N Particles per second (or per distance travelled), based on a particle from a system
56-
* **Trigger Event Always** : Spawns N Particles every Frame.
58+
These Blocks connect to a **GPUEvent** Context. This Context does not handle any Blocks, but instead connects to an Initialize Context of a child system.
5759

58-
These Blocks connect to a **GPUEvent** Context. This context does not handle any Blocks but instead connects to a Initialize Context of a child system.
60+
To gather data from the parent particle, a child system must refer to [Source Attributes](Attributes.md) in its Initialize Context. To do this, a child system can use a **Get Source Attribute** Operator, or an **Inherit Attribute** Block. For a visual example, see the image below.
5961

60-
In order to gather data from the parent particle, the child system must refer to [Source Attributes](Attributes.md) in its Initialize Context, by using **Get Source Attribute Operator**, or **Inherit Attribute Block**,as shown as in the example above : The child System inherits the source position of the particle that created it, and inherits roughly 50% of its speed.
62+
![](Images/GPUEvent.png)*In this example, the child System inherits the source position of the particle that creates it. It also inherit roughly 50% of the parent particle's speed.*

com.unity.visualeffectgraph/Documentation~/GettingStarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To preview an effect, you can:
6969

7070
This lets you edit parameters directly in the Scene, see the lighting on your effect, and use the [Target GameObject Panel](VisualEffectGraphWindow.md#target-visual-effect-gameobject) features for the specific target instance of your effect.
7171

72-
## Manipulating Graph Elements
72+
## Manipulating graph elements
7373
When you open an Asset inside the Visual Effect Graph window, you can see and edit the graph for that specific Asset.
7474

7575
A Visual Effect Graph contains [Operator Nodes](Operators.md) and [Blocks](Blocks.md). Each Node is in charge of processing its input properties. You can link Nodes together to perform a series of calculations. All Nodes end up connecting into a Block (or a context) : A Block defines an operation on an effect, based on its input properties.

com.unity.visualeffectgraph/Documentation~/GraphLogicAndPhilosophy.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The Visual Effect Graph uses two distinct workflows:
99
## Processing workflow (vertical logic)
1010
The processing workflow links together a succession of customizable stages to define the complete system logic. This is where you can determine when the spawn, initialization, updating, and rendering of the particles happen during the effect.
1111

12-
The processing workflow connects Contexts using their **Flow Slots** located at the top and the bottom of the Context Node.
12+
The processing workflow connects Contexts using their **flow slots** located at the top and the bottom of the Context Node.
1313

1414
The processing logic defines the different stages of processing of a visual effect. Each stage consists of a large colored container called a [Contexts](Contexts.md). Each Context connects to another compatible Context, which defines how the next stage of processing uses the current Context.
1515

@@ -23,13 +23,13 @@ The Visual Effect Graph comes with a large Block and Node library that you can t
2323

2424
To customize how particles behave, you can connect horizontal Nodes to a Block to create a custom a mathematical expression. To do this, use the **Create Node** context menu to add Nodes, change their values, then connect the Nodes to Block properties.
2525

26-
## Graph Elements
26+
## Graph elements
2727

28-
A Visual Effect Graph provides a workspace where you can create Graph Elements and connect them together to define effect behaviors. The Visual Effect Graph comes with many different types of Graph Elements that fit into the workspace.
28+
A Visual Effect Graph provides a workspace where you can create graph elements and connect them together to define effect behaviors. The Visual Effect Graph comes with many different types of graph elements that fit into the workspace.
2929

3030
### Workspace
3131

32-
A Visual Effect Graph provides a **Workspace** where you can create Graph Elements and connect them together to define effect behaviors.
32+
A Visual Effect Graph provides a **Workspace** where you can create graph elements and connect them together to define effect behaviors.
3333

3434
![The vertical workflow contains Systems, which then contain Contexts, which then contain Blocks. Together, they determine when something happens during the “lifecycle” of the visual effect.](Images/SystemVisual.png)
3535

@@ -74,7 +74,7 @@ While the graph elements are different, their contents and behavior tend to be t
7474

7575
#### Settings
7676

77-
Settings are Fields that you cannot connect to using the property workflow. Every Graph Element displays settings:
77+
Settings are Fields that you cannot connect to using the property workflow. Every graph element displays settings:
7878

7979
* In the **Graph** : Between the Title and the property container in the Graph.
8080
* In the **Inspector** : When you select a Node, the Inspector displays additional, advanced settings.
@@ -85,7 +85,7 @@ If you change the value of a setting, you need to recompile the Graph to see the
8585

8686
[Properties](Properties.md) are Fields that you can edit and connect to using the property workflow. You can connect them to other properties contained in other graph elements.
8787

88-
## Other Graph Elements
88+
## Other graph elements
8989

9090
### Groups
9191

com.unity.visualeffectgraph/Documentation~/Properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div style="border: solid 1px #999; border-radius:12px; background-color:#EEE; padding: 8px; padding-left:14px; color: #555; font-size:14px;"><b>Draft:</b> The content on this page is complete, but it has not been reviewed yet.</div>
22
# Properties
33

4-
Properties are editable fields that you can connect to graph elements using [Property workflow](GraphLogicAndPhilosophy.md). They can be found on Graph Elements such as [Contexts](Contexts.md), [Blocks](Blocks.md) and [Operators](Operators.md).
4+
Properties are editable fields that you can connect to graph elements using [Property workflow](GraphLogicAndPhilosophy.md). They can be found on graph elements such as [Contexts](Contexts.md), [Blocks](Blocks.md) and [Operators](Operators.md).
55

66
## Using Properties
77

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Sticky Notes
2+
3+
Sticky Notes are objects in a graph view that you can write in. They are the graph view equivalent of a comment in code, and consist of a title and body. You can create as many as you want in the graph, and use them for a variety of purposes, for example:
4+
5+
- To describe how a section of your graph works.
6+
- To leave notes for yourself or others collaborating in your Unity Project.
7+
- As a to-do list that includes tasks to complete at a later date.
8+
9+
## Using Sticky Notes
10+
11+
To create a Sticky Note, right-click an empty space in the graph view and, in the context menu, click **Create Sticky note**. You can now customize and add content to the new Sticky Note. There are two text areas that you can write to:
12+
13+
- **Title**: The text area at the top of the Sticky Note is the title. Here you can concisely describe what the Sticky Note contains in its body text area. For example, this could be the name of the graph section the Sticky Note describes.
14+
- **Body**: The larger text area below the title area is the body. You can write the full contents of the note here.
15+
16+
### Controls
17+
18+
This section describes how to edit text, move and resize the Sticky Note, and perform other actions.
19+
20+
#### Editing text
21+
22+
To edit text on a Sticky Note, double-click on a text area. This also selects all of the text in the area so be sure to move the text cursor before you edit the text.
23+
24+
#### Moving and resizing
25+
26+
You can move Sticky Notes anywhere on the graph. For information on how to do this, see [manipulating graph elements](VisualEffectGraphWindow.md#moving-elements).
27+
28+
You can also resize Sticky Notes. You can resize the Sticky Note manually or the Sticky Note can resize itself automatically to fit its contents. For information on how to make the Sticky Note resize itself, see the **Fit To Text** option in the [Context menu](#context-menu). For information on how to resize the Sticky Note manually, see [manipulating graph elements](VisualEffectGraphWindow.md#moving-elements).
29+
30+
#### Duplicating
31+
32+
You can also cut, copy, paste, and duplicate Sticky Notes. For information on how to perform these actions, see [duplicating elements](VisualEffectGraphWindow.md#copy-cut-and-paste-and-duplicate-elements).
33+
34+
#### Context menu
35+
36+
To open the context menu for the Sticky Note, right-click anywhere on the Sticky Note. The options in the context menu are as follows.
37+
38+
| **Option** | **Description** |
39+
| -------------------------- | ------------------------------------------------------------ |
40+
| **Dark Theme/Light Theme** | Toggles the color theme of the Sticky Note between light theme and dark theme. |
41+
| **Text Size** | Resizes the font in the text areas to the following values: |
42+
| Small | Title: 20<br/>Body: 11 |
43+
| Medium | Title: 40<br/>Body: 24 |
44+
| Large | Title: 60<br/>Body: 36 |
45+
| Huge | Title: 80<br/>Body: 56 |
46+
| **Fit To Text** | Resizes the Sticky Note so that it precisely fits the text areas.<br/>**Note**: If your title spreads over more than a single line, this horizontally resizes the Sticky Note to the smallest size where the title text fits on a single line. |

com.unity.visualeffectgraph/Documentation~/TableOfContents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [Attributes](Attributes.md)
1313
* [Subgraph](Subgraph.md)
1414
* [Blackboard](Blackboard.md)
15+
* [Sticky Notes](StickyNotes.md)
1516
* [Project Settings](VisualEffectProjectSettings.md)
1617
* [Preferences](VisualEffectPreferences.md)
1718
* [The Visual Effect Component](VisualEffectComponent.md)

com.unity.visualeffectgraph/Documentation~/VisualEffectGraphWindow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The navigation controls for the Node Workspace are similar to those that other g
100100
* **Duplicate**: Ctrl+D.
101101
* **Duplicate with edges**: Ctrl+Alt+D.
102102

103-
### Adding Graph Elements
103+
### Adding graph elements
104104

105105
To add graph elements, you can use any of the following methods:
106106

0 commit comments

Comments
 (0)