Material properties and Blueprint nodes

Double-click on TargetRed to open a new Editor tab for editing the Material, like this:

You are now looking at the Material Editor, which shares many features and conventions with Blueprints. The center of this screen is called the grid, and this is where we place all the objects that define the logic of our Materials. The initial object you see in the center of the grid screen, labeled with the name of the Material, is called a node. This node, as seen in the previous screenshot, has a series of input pins that other Material nodes can attach to in order to define this node's properties.

To give the Material a color, we need to create a node that provides information about the color to the input labeled Base Color on this node. To do so, right-click on an empty space near the node. A popup with a search box and a long list of expandable options appears. This shows all the available Material node options that we can add to this Material. The search box is context-sensitive, so if you start typing the first few letters of a valid node name, you will see the list below the search field shrink to include only those nodes that include those letters in their names. The node we are looking for is called VectorParameter, so we start typing this name in the search box and click on the VectorParameter result to add that node to our grid:

A vector parameter in the Material Editor allows us to define a color, which we can then attach to the Base Color input on the tall Material definition node. We first need to give the node a color selection. Double-click on the black square in the middle of the node to open Color Picker. We want to give our target a bright red color when it is hit, so either drag the center point in the color wheel to the red section of the wheel, or fill in the RGB or Hex values manually. When you have selected the shade of red you want to use, click on OK. You will notice that the black box in your vector parameter node has now turned red.

To help ourselves remember what parameter or property of the Material our vector parameter will be defined by, we should name it Color. You can do this by ensuring that you have the vector parameter node selected (indicated by a thin yellow highlight around the node), and then navigating to the Details panel in the Editor. Enter a value for Parameter Name, and the node label changes automatically:

The final step is to link our color vector parameter node to the base Material node. In the same way as with Blueprints, you can connect two nodes by clicking and dragging from one node's output pin to another node's input pin. Input pins are located on the left-hand side of a node, while output pins are always located on the right-hand side. The thin line that connects two nodes that have been connected in this way is called a wire. For our Material, we need to click and drag a wire from the top output pin of the Color node to the Base Color input pin of the Material node, as shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset