Unity Shader Graph: Split Vector3

On this page


    As a new game developer, Shader Graph can be a tough nut to crack. As a Shader Graph pro, I wanted to put together this super short guide on how to use Shader Graph nodes to split a Vector3 into the x, y, z components.

    How to Split a Vector3 in Shader Graph

    1. To split a Vector3, use the Split Node. 
    2. To create the Split Node, open Shader Graph, Right Click > Create Node > Channel > Split. 
    3. To attach the Vector3, drag the Vector3 node’s Out port to the Split node’s In port.

    Unity has more documentation on the Split node.

    Great, so you’ve split the Vector3. Now you want to put it back together again to make a Vector2. Ruh roh!
    Just kidding, I got you. In the section section, I will show you how to make a new Vector2 from individual float ports from the Split node.

    How to make a Vector2 using the Split node

    Here’s how to use the Split node to create a new Vector2 from the X/Z components of the Vector3.

    1. To create a Vector2, use the Vector2 node.
    2. To create the Vector2 Node, open Shader Graph, Right Click > Create Node > Input > Basic > Vector2
    3. To assign the components of the Vector2, drag the Split node’s Out ports to the Vector2 node’s X and Y ports.


    As you can see, it’s easy to deconstruct and reconstruct vectors in Unity’s Shader Graph. By using Split and Vector nodes, you can tear down and build up any vector you want.

    To continue building your shader and math skills, you should read my comprehensive guide to HLSL’s Step function. Then, get comfortable using linear interpolation with my Lerp essentials guide.

    Join our newsletter to get the latest updates
    Sign Up
    Michael Sacco
    Founder & CEO

    Michael Sacco is the Founder and CEO of OccaSoftware where he specializes in developing game assets for Unity game developers. With a background ranging from startups to American Express, he's been building great products for more than 10 years.

    Unity Basics