Sprite billboarding in DOTS + ECS

I’m struggling to find a way to do the following:
There are two entities. B is a child of A. A is bound to rotate with mouse movement. B SHOULD “stay upright in the world”.

I think what I need is to do a quaternion rotation from B’s up to “absolute world up, at B’s localToWorld.Position”.

Here’s a reference video to what I’m trying accomplish, but with ECS:

Thanks a ton in advance, for anyone that’s able to help!

5 Answers

5

Here is how you create a billboard system:

using UnityEngine;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;

public class BillboardAuthoring : MonoBehaviour
{
    [SerializeField] EMode _mode = EMode.YAxis;

#if UNITY_EDITOR
    void OnDrawGizmos ()
    {
        UnityEditor.Handles.Label( transform.position , _mode.ToString() );
    }
#endif

    public class Baker : Baker<BillboardAuthoring>
    {
        public override void Bake ( BillboardAuthoring authoring )
        {
            Entity entity = this.GetEntity( authoring , TransformUsageFlags.WorldSpace );
            if( authoring._mode==EMode.Basic ) AddComponent<IsBasicBillboard>( entity );
            else if( authoring._mode==EMode.YAxis ) AddComponent<IsYAxisBillboard>( entity );
        }
    }

    public enum EMode : byte
    {
        Basic , YAxis
    }
}

[UpdateInGroup( typeof(PresentationSystemGroup) )]
[WorldSystemFilter( WorldSystemFilterFlags.Default | WorldSystemFilterFlags.Editor )]
[RequireMatchingQueriesForUpdate]
public partial struct BillboardBasicSystem : ISystem
{
    public void OnUpdate ( ref SystemState state )
    {
        Camera cam = Camera.main;
        if( cam==null ) return;
        Transform cameraTransform = cam.transform;
        float4x4 ltw = cameraTransform.localToWorldMatrix;
        new Job{
            C0 = ltw.c0 ,
            C1 = ltw.c1 ,
            C2 = ltw.c2 ,
        }.ScheduleParallel();
    }

    [WithAll( typeof(IsBasicBillboard) )]
    [Unity.Burst.BurstCompile]
    public partial struct Job : IJobEntity
    {
        public float4 C0, C1, C2;
        void Execute ( ref LocalToWorld transform )
        {
            transform.Value.c0 = C0;
            transform.Value.c1 = C1;
            transform.Value.c2 = C2;
        }
    }
}

[UpdateInGroup( typeof(PresentationSystemGroup) )]
[WorldSystemFilter( WorldSystemFilterFlags.Default | WorldSystemFilterFlags.Editor )]
[RequireMatchingQueriesForUpdate]
public partial struct BillboardYAxisSystem : ISystem
{
    public void OnUpdate ( ref SystemState state )
    {
        Camera cam = Camera.main;
        if( cam==null ) return;
        new Job{
            CameraPosition = cam.transform.position ,
        }.ScheduleParallel();
    }

    [WithAll( typeof(IsYAxisBillboard) )]
    [Unity.Burst.BurstCompile]
    public partial struct Job : IJobEntity
    {
        public float3 CameraPosition;
        void Execute ( ref LocalToWorld transform )
        {
            // z
            float3 position = transform.Position;
            float3 target = new float3( CameraPosition.x , position.y , CameraPosition.z );
            float zscale = math.length( transform.Value.c2 );
            float3 z = -math.normalize(target-position);
            transform.Value.c2 = new float4( z * zscale , 0 );
            
            // y
            float yscale = math.length( transform.Value.c1 );
            transform.Value.c1 = new float4(0,yscale,0,0);

            // x
            float3 x = new float3( transform.Value.c0.x , transform.Value.c0.y , transform.Value.c0.z );
            float xscale = math.length( transform.Value.c0 );
            transform.Value.c0 = new float4( math.cross(z,new float3(0,1,0)) * xscale , 0 );
        }
    }
}

public struct IsBasicBillboard : IComponentData {}
public struct IsYAxisBillboard : IComponentData {}

A better answer:

Let GPU do this work via vertex shader. ECS/Burst are cool but no CPU involvement is almost always better :ok_hand:.

y_axis_billboard.shadergraph

{
    "m_SGVersion": 3,
    "m_Type": "UnityEditor.ShaderGraph.GraphData",
    "m_ObjectId": "80cb4d329af2482aaa63ce452eaae22f",
    "m_Properties": [
        {
            "m_Id": "85672431213548ca8a0ef8bc5f543d8c"
        }
    ],
    "m_Keywords": [],
    "m_Dropdowns": [],
    "m_CategoryData": [
        {
            "m_Id": "4297c401299a4f48a401d53ed3a76471"
        }
    ],
    "m_Nodes": [
        {
            "m_Id": "635f8317c1d6444c963b9d6e621b45b9"
        },
        {
            "m_Id": "6e737174c3bc48a893525e11d8b94eb6"
        },
        {
            "m_Id": "063559dd18bb40949fba96df86db5c17"
        },
        {
            "m_Id": "231b4bcce88249ea9294317ac9f620d1"
        },
        {
            "m_Id": "92c17bcc8b8c425c9582a5c1a1fe81e8"
        },
        {
            "m_Id": "37375e12bf3c41eb91c35e09b4e7946f"
        },
        {
            "m_Id": "e32470a4c1ba4209826e24682298701c"
        },
        {
            "m_Id": "bdc0ea7eb9cb447d8dd08fcfbcd34555"
        },
        {
            "m_Id": "325e4f19c5294b69a36f11265d8641b9"
        },
        {
            "m_Id": "2662bd3f11554d08aaccba49bd287b99"
        },
        {
            "m_Id": "eb63323c6b5d49feacc5978986facc6f"
        },
        {
            "m_Id": "35fc4044314442a584349e8789db0747"
        },
        {
            "m_Id": "277efdbd13144e5daf3a0752b8581470"
        },
        {
            "m_Id": "d31479c4d4c64b049755104be6939c44"
        },
        {
            "m_Id": "5a76b4302dec45ddb2190ecc57c281d9"
        },
        {
            "m_Id": "e01343c4cdb845dcb252212877f70ee4"
        },
        {
            "m_Id": "cf8ac88182a54394afb4615ded88792e"
        },
        {
            "m_Id": "6404d7bbf8624faf931ba1471844502d"
        }
    ],
    "m_GroupDatas": [],
    "m_StickyNoteDatas": [],
    "m_Edges": [
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "2662bd3f11554d08aaccba49bd287b99"
                },
                "m_SlotId": 1
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "eb63323c6b5d49feacc5978986facc6f"
                },
                "m_SlotId": 1
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "277efdbd13144e5daf3a0752b8581470"
                },
                "m_SlotId": 0
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "d31479c4d4c64b049755104be6939c44"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "325e4f19c5294b69a36f11265d8641b9"
                },
                "m_SlotId": 0
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "5a76b4302dec45ddb2190ecc57c281d9"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "35fc4044314442a584349e8789db0747"
                },
                "m_SlotId": 3
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "635f8317c1d6444c963b9d6e621b45b9"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "37375e12bf3c41eb91c35e09b4e7946f"
                },
                "m_SlotId": 1
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "e32470a4c1ba4209826e24682298701c"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "5a76b4302dec45ddb2190ecc57c281d9"
                },
                "m_SlotId": 2
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "eb63323c6b5d49feacc5978986facc6f"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "6404d7bbf8624faf931ba1471844502d"
                },
                "m_SlotId": 0
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "231b4bcce88249ea9294317ac9f620d1"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "6404d7bbf8624faf931ba1471844502d"
                },
                "m_SlotId": 7
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "e01343c4cdb845dcb252212877f70ee4"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "92c17bcc8b8c425c9582a5c1a1fe81e8"
                },
                "m_SlotId": 1
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "37375e12bf3c41eb91c35e09b4e7946f"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "bdc0ea7eb9cb447d8dd08fcfbcd34555"
                },
                "m_SlotId": 2
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "35fc4044314442a584349e8789db0747"
                },
                "m_SlotId": 2
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "bdc0ea7eb9cb447d8dd08fcfbcd34555"
                },
                "m_SlotId": 2
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "d31479c4d4c64b049755104be6939c44"
                },
                "m_SlotId": 2
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "cf8ac88182a54394afb4615ded88792e"
                },
                "m_SlotId": 0
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "6404d7bbf8624faf931ba1471844502d"
                },
                "m_SlotId": 1
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "d31479c4d4c64b049755104be6939c44"
                },
                "m_SlotId": 3
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "6e737174c3bc48a893525e11d8b94eb6"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "e32470a4c1ba4209826e24682298701c"
                },
                "m_SlotId": 1
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "bdc0ea7eb9cb447d8dd08fcfbcd34555"
                },
                "m_SlotId": 0
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "e32470a4c1ba4209826e24682298701c"
                },
                "m_SlotId": 3
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "bdc0ea7eb9cb447d8dd08fcfbcd34555"
                },
                "m_SlotId": 1
            }
        },
        {
            "m_OutputSlot": {
                "m_Node": {
                    "m_Id": "eb63323c6b5d49feacc5978986facc6f"
                },
                "m_SlotId": 2
            },
            "m_InputSlot": {
                "m_Node": {
                    "m_Id": "35fc4044314442a584349e8789db0747"
                },
                "m_SlotId": 0
            }
        }
    ],
    "m_VertexContext": {
        "m_Position": {
            "x": 0.0,
            "y": 0.0
        },
        "m_Blocks": [
            {
                "m_Id": "635f8317c1d6444c963b9d6e621b45b9"
            },
            {
                "m_Id": "6e737174c3bc48a893525e11d8b94eb6"
            },
            {
                "m_Id": "063559dd18bb40949fba96df86db5c17"
            }
        ]
    },
    "m_FragmentContext": {
        "m_Position": {
            "x": -0.00002384185791015625,
            "y": 532.0
        },
        "m_Blocks": [
            {
                "m_Id": "231b4bcce88249ea9294317ac9f620d1"
            },
            {
                "m_Id": "e01343c4cdb845dcb252212877f70ee4"
            }
        ]
    },
    "m_PreviewData": {
        "serializedMesh": {
            "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
            "m_Guid": ""
        },
        "preventRotation": false
    },
    "m_Path": "Shader Graphs",
    "m_GraphPrecision": 1,
    "m_PreviewMode": 2,
    "m_OutputNode": {
        "m_Id": ""
    },
    "m_SubDatas": [],
    "m_ActiveTargets": [
        {
            "m_Id": "c548ef7607014e0da7a8e20ba3e418e9"
        }
    ]
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "02ffabbb5d2540c9978d43fe9bced66e",
    "m_Id": 4,
    "m_DisplayName": "Far Plane",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Far Plane",
    "m_StageCapability": 3,
    "m_Value": 1.0,
    "m_DefaultValue": 1.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.BlockNode",
    "m_ObjectId": "063559dd18bb40949fba96df86db5c17",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "VertexDescription.Tangent",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": 0.0,
            "y": 0.0,
            "width": 0.0,
            "height": 0.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "ef119d9737b248aab2997c014c8e18bc"
        }
    ],
    "synonyms": [],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_SerializedDescriptor": "VertexDescription.Tangent"
}

{
    "m_SGVersion": 2,
    "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget",
    "m_ObjectId": "081930db40d3417eaa49d6e6df667383"
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "11c6a4fd998645218cee336bbfcb2edc",
    "m_Id": 0,
    "m_DisplayName": "In",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "In",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "16afa4add64447f799abb5bd6004fb55",
    "m_Id": 5,
    "m_DisplayName": "Z Buffer Sign",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Z Buffer Sign",
    "m_StageCapability": 3,
    "m_Value": 1.0,
    "m_DefaultValue": 1.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "16b9357b55494da0b1940bd5d5e57936",
    "m_Id": 2,
    "m_DisplayName": "World Bounds Min",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "World Bounds Min",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    "m_ObjectId": "17234cae634b4599bc55b9e1f568a9e0",
    "m_Id": 0,
    "m_DisplayName": "In",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "In",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "21821b9616e445458615181a9341aa56",
    "m_Id": 2,
    "m_DisplayName": "Rotation",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Rotation",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.BlockNode",
    "m_ObjectId": "231b4bcce88249ea9294317ac9f620d1",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "SurfaceDescription.BaseColor",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": 0.0,
            "y": 0.0,
            "width": 0.0,
            "height": 0.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "597474c07860476ebfc4d50be1b31f22"
        }
    ],
    "synonyms": [],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.ObjectNode",
    "m_ObjectId": "2662bd3f11554d08aaccba49bd287b99",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Object",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -702.0,
            "y": -201.0,
            "width": 153.0,
            "height": 173.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "e4341a2a112347e89e6a8a1a1f722075"
        },
        {
            "m_Id": "807fca3843a848d4bf68ecd40375fe7b"
        },
        {
            "m_Id": "16b9357b55494da0b1940bd5d5e57936"
        },
        {
            "m_Id": "ca2f6195da984047a45d29dd06c85252"
        },
        {
            "m_Id": "835e2be9954a4ec284e3a00899f98e0f"
        }
    ],
    "synonyms": [
        "position",
        "scale",
        "bounds",
        "size"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.NormalVectorNode",
    "m_ObjectId": "277efdbd13144e5daf3a0752b8581470",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Normal Vector",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -598.0,
            "y": 156.0,
            "width": 206.0,
            "height": 131.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "73db6d308de348e69080623523c9292a"
        }
    ],
    "synonyms": [
        "surface direction"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 2,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_Space": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "2b00144db2ef47df8765e2d9ec197ab4",
    "m_Id": 6,
    "m_DisplayName": "B",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "B",
    "m_StageCapability": 2,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "2b0e6acb90c543a5b15de86a021447af",
    "m_Id": 2,
    "m_DisplayName": "Orthographic",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Orthographic",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "2da8c8085d9b4bcc8ddcfb7e64076d8c",
    "m_Id": 4,
    "m_DisplayName": "A",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "A",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 1,
    "m_Type": "UnityEditor.ShaderGraph.PositionNode",
    "m_ObjectId": "325e4f19c5294b69a36f11265d8641b9",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Position",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -1069.0,
            "y": -319.0,
            "width": 206.0,
            "height": 131.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "a5c2335391b24eba8684558f71ed4c27"
        }
    ],
    "synonyms": [
        "location"
    ],
    "m_Precision": 1,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 2,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_Space": 0,
    "m_PositionSource": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.RotateAboutAxisNode",
    "m_ObjectId": "35fc4044314442a584349e8789db0747",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Rotate About Axis",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -353.0,
            "y": -177.0,
            "width": 164.0,
            "height": 177.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "a0c81fc904994163b5814cfe3f4c0c9e"
        },
        {
            "m_Id": "7216b51f10244b729a192c02fb53d251"
        },
        {
            "m_Id": "21821b9616e445458615181a9341aa56"
        },
        {
            "m_Id": "906e24db9e29473a9d73e2cce946828d"
        }
    ],
    "synonyms": [
        "pivot"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_Unit": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "35fcd8a35e934a62b88bc5cab307c568",
    "m_Id": 4,
    "m_DisplayName": "R",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "R",
    "m_StageCapability": 2,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 2,
    "m_Type": "UnityEditor.ShaderGraph.TransformNode",
    "m_ObjectId": "37375e12bf3c41eb91c35e09b4e7946f",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Transform",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -882.0,
            "y": -28.0,
            "width": 212.0,
            "height": 157.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "e5089fcc9fda4f17988359022363b0bd"
        },
        {
            "m_Id": "5efb1da245c94867ab8d5324d594c99d"
        }
    ],
    "synonyms": [
        "world",
        "tangent",
        "object",
        "view",
        "screen",
        "convert"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_Conversion": {
        "from": 2,
        "to": 0
    },
    "m_ConversionType": 1,
    "m_Normalize": true
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.CategoryData",
    "m_ObjectId": "4297c401299a4f48a401d53ed3a76471",
    "m_Name": "",
    "m_ChildObjectList": [
        {
            "m_Id": "85672431213548ca8a0ef8bc5f543d8c"
        }
    ]
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "46541f5acf8a49fea801a78356bc6585",
    "m_Id": 1,
    "m_DisplayName": "Axis",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Axis",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 1.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
    "m_ObjectId": "4bc7038d56c84ff6aea7a85b048ecca1",
    "m_Id": 0,
    "m_DisplayName": "A",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "A",
    "m_StageCapability": 3,
    "m_Value": {
        "e00": 0.0,
        "e01": 0.0,
        "e02": 0.0,
        "e03": 0.0,
        "e10": 0.0,
        "e11": 0.0,
        "e12": 0.0,
        "e13": 0.0,
        "e20": 0.0,
        "e21": 0.0,
        "e22": 0.0,
        "e23": 0.0,
        "e30": 0.0,
        "e31": 0.0,
        "e32": 0.0,
        "e33": 0.0
    },
    "m_DefaultValue": {
        "e00": 1.0,
        "e01": 0.0,
        "e02": 0.0,
        "e03": 0.0,
        "e10": 0.0,
        "e11": 1.0,
        "e12": 0.0,
        "e13": 0.0,
        "e20": 0.0,
        "e21": 0.0,
        "e22": 1.0,
        "e23": 0.0,
        "e30": 0.0,
        "e31": 0.0,
        "e32": 0.0,
        "e33": 1.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "4c120954e49d44c6a046fa5adbb29cfb",
    "m_Id": 5,
    "m_DisplayName": "G",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "G",
    "m_StageCapability": 2,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "53e7f127466a428b81bb735c2cc7d722",
    "m_Id": 3,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot",
    "m_ObjectId": "58dadada812e41ecac4e82c662e3808b",
    "m_Id": 1,
    "m_DisplayName": "Texture",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Texture",
    "m_StageCapability": 3,
    "m_BareResource": false,
    "m_Texture": {
        "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
        "m_Guid": ""
    },
    "m_DefaultType": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
    "m_ObjectId": "597474c07860476ebfc4d50be1b31f22",
    "m_Id": 0,
    "m_DisplayName": "Base Color",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "BaseColor",
    "m_StageCapability": 2,
    "m_Value": {
        "x": 0.5,
        "y": 0.5,
        "z": 0.5
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": [],
    "m_ColorMode": 0,
    "m_DefaultColor": {
        "r": 0.5,
        "g": 0.5,
        "b": 0.5,
        "a": 1.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    "m_ObjectId": "59a801a209f04a6c9cd225e5bdc83c6b",
    "m_Id": 2,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.AddNode",
    "m_ObjectId": "5a76b4302dec45ddb2190ecc57c281d9",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Add",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -679.0,
            "y": -319.0,
            "width": 130.0,
            "height": 118.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "92890b194a434145a91ca47938554b36"
        },
        {
            "m_Id": "ac9359885b1e49aca8d794c8f6a0c5a5"
        },
        {
            "m_Id": "59a801a209f04a6c9cd225e5bdc83c6b"
        }
    ],
    "synonyms": [
        "addition",
        "sum",
        "plus"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    "m_ObjectId": "5ea464bc9f65451ba987890d6958ebbf",
    "m_Id": 2,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "5efb1da245c94867ab8d5324d594c99d",
    "m_Id": 1,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.BlockNode",
    "m_ObjectId": "635f8317c1d6444c963b9d6e621b45b9",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "VertexDescription.Position",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": 0.0,
            "y": 0.0,
            "width": 0.0,
            "height": 0.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "deab0ef59ea843108483c8287cdc51d0"
        }
    ],
    "synonyms": [],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_SerializedDescriptor": "VertexDescription.Position"
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode",
    "m_ObjectId": "6404d7bbf8624faf931ba1471844502d",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Sample Texture 2D",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -372.00006103515627,
            "y": 537.0000610351563,
            "width": 183.00003051757813,
            "height": 251.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "ed1ade71b4d24ff2a85eaba521accd74"
        },
        {
            "m_Id": "35fcd8a35e934a62b88bc5cab307c568"
        },
        {
            "m_Id": "4c120954e49d44c6a046fa5adbb29cfb"
        },
        {
            "m_Id": "2b00144db2ef47df8765e2d9ec197ab4"
        },
        {
            "m_Id": "e9114e90211c42a4a483a6ef1c3010a3"
        },
        {
            "m_Id": "58dadada812e41ecac4e82c662e3808b"
        },
        {
            "m_Id": "96a3b4d91bf34ebd93708df05488bda7"
        },
        {
            "m_Id": "faf7b6f99c4b45e0bd4c1177b132b340"
        }
    ],
    "synonyms": [
        "tex2d"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_TextureType": 0,
    "m_NormalMapSpace": 0,
    "m_EnableGlobalMipBias": true,
    "m_MipSamplingMode": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.BlockNode",
    "m_ObjectId": "6e737174c3bc48a893525e11d8b94eb6",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "VertexDescription.Normal",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": 0.0,
            "y": 0.0,
            "width": 0.0,
            "height": 0.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "9121028c3d77477eaaf73fb4f086e2fa"
        }
    ],
    "synonyms": [],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_SerializedDescriptor": "VertexDescription.Normal"
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "7216b51f10244b729a192c02fb53d251",
    "m_Id": 1,
    "m_DisplayName": "Axis",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Axis",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 1.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "73db6d308de348e69080623523c9292a",
    "m_Id": 0,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 1.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
    "m_ObjectId": "7ce3ac7090b241ca988dd8882bfb7947",
    "m_Id": 1,
    "m_DisplayName": "B",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "B",
    "m_StageCapability": 3,
    "m_Value": {
        "e00": 2.0,
        "e01": 2.0,
        "e02": 2.0,
        "e03": 2.0,
        "e10": 2.0,
        "e11": 2.0,
        "e12": 2.0,
        "e13": 2.0,
        "e20": 2.0,
        "e21": 2.0,
        "e22": 2.0,
        "e23": 2.0,
        "e30": 2.0,
        "e31": 2.0,
        "e32": 2.0,
        "e33": 2.0
    },
    "m_DefaultValue": {
        "e00": 1.0,
        "e01": 0.0,
        "e02": 0.0,
        "e03": 0.0,
        "e10": 0.0,
        "e11": 1.0,
        "e12": 0.0,
        "e13": 0.0,
        "e20": 0.0,
        "e21": 0.0,
        "e22": 1.0,
        "e23": 0.0,
        "e30": 0.0,
        "e31": 0.0,
        "e32": 0.0,
        "e33": 1.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "807fca3843a848d4bf68ecd40375fe7b",
    "m_Id": 1,
    "m_DisplayName": "Scale",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Scale",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "826cf851eb2543beb44bd96eecceb201",
    "m_Id": 0,
    "m_DisplayName": "Position",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Position",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "835e2be9954a4ec284e3a00899f98e0f",
    "m_Id": 4,
    "m_DisplayName": "Bounds Size",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Bounds Size",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
    "m_ObjectId": "85672431213548ca8a0ef8bc5f543d8c",
    "m_Guid": {
        "m_GuidSerialized": "d2dff728-23ea-4e74-bead-a71cf83c7544"
    },
    "m_Name": "Color",
    "m_DefaultRefNameVersion": 1,
    "m_RefNameGeneratedByDisplayName": "Color",
    "m_DefaultReferenceName": "_Color",
    "m_OverrideReferenceName": "",
    "m_GeneratePropertyBlock": true,
    "m_UseCustomSlotLabel": false,
    "m_CustomSlotLabel": "",
    "m_DismissedVersion": 0,
    "m_Precision": 0,
    "overrideHLSLDeclaration": false,
    "hlslDeclarationOverride": 0,
    "m_Hidden": false,
    "m_Value": {
        "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
        "m_Guid": ""
    },
    "isMainTexture": false,
    "useTilingAndOffset": false,
    "m_Modifiable": true,
    "m_DefaultType": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",
    "m_ObjectId": "8646b417f10347659a9a484473211a50",
    "m_Id": 0,
    "m_DisplayName": "Color",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_BareResource": false
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "8a6a45a286a54da6948c21d7f57e172c",
    "m_Id": 0,
    "m_DisplayName": "Alpha",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Alpha",
    "m_StageCapability": 2,
    "m_Value": 1.0,
    "m_DefaultValue": 1.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "906e24db9e29473a9d73e2cce946828d",
    "m_Id": 3,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
    "m_ObjectId": "9121028c3d77477eaaf73fb4f086e2fa",
    "m_Id": 0,
    "m_DisplayName": "Normal",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Normal",
    "m_StageCapability": 1,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": [],
    "m_Space": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    "m_ObjectId": "92890b194a434145a91ca47938554b36",
    "m_Id": 0,
    "m_DisplayName": "A",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "A",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.CameraNode",
    "m_ObjectId": "92c17bcc8b8c425c9582a5c1a1fe81e8",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Camera",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -1038.0,
            "y": -28.0,
            "width": 123.0,
            "height": 245.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "826cf851eb2543beb44bd96eecceb201"
        },
        {
            "m_Id": "bc88e557ccf4407b93a2536b512f4e3c"
        },
        {
            "m_Id": "2b0e6acb90c543a5b15de86a021447af"
        },
        {
            "m_Id": "d140504a1d4845c4b26d679530527aa3"
        },
        {
            "m_Id": "02ffabbb5d2540c9978d43fe9bced66e"
        },
        {
            "m_Id": "16afa4add64447f799abb5bd6004fb55"
        },
        {
            "m_Id": "e729fee4b268475f992824482ea4747d"
        },
        {
            "m_Id": "e2bdfd6f3ae4408391020d3d82437d5a"
        }
    ],
    "synonyms": [
        "position",
        "direction",
        "orthographic",
        "near plane",
        "far plane",
        "width",
        "height"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot",
    "m_ObjectId": "96a3b4d91bf34ebd93708df05488bda7",
    "m_Id": 2,
    "m_DisplayName": "UV",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "UV",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0
    },
    "m_Labels": [],
    "m_Channel": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "a0c81fc904994163b5814cfe3f4c0c9e",
    "m_Id": 0,
    "m_DisplayName": "In",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "In",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "a5c2335391b24eba8684558f71ed4c27",
    "m_Id": 0,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    "m_ObjectId": "ac9359885b1e49aca8d794c8f6a0c5a5",
    "m_Id": 1,
    "m_DisplayName": "B",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "B",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.5,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "b2be4eb8902e423dac8fc9557eae894b",
    "m_Id": 3,
    "m_DisplayName": "B",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "B",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "bc88e557ccf4407b93a2536b512f4e3c",
    "m_Id": 1,
    "m_DisplayName": "Direction",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Direction",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Arctangent2Node",
    "m_ObjectId": "bdc0ea7eb9cb447d8dd08fcfbcd34555",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Arctangent2",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -518.0,
            "y": -28.0,
            "width": 126.0,
            "height": 118.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "f4d09c507d224a19b74f7bf633725fd1"
        },
        {
            "m_Id": "c494607044db436eba18058df443f3d0"
        },
        {
            "m_Id": "5ea464bc9f65451ba987890d6958ebbf"
        }
    ],
    "synonyms": [
        "atan2"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    "m_ObjectId": "c494607044db436eba18058df443f3d0",
    "m_Id": 1,
    "m_DisplayName": "B",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "B",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    }
}

{
    "m_SGVersion": 1,
    "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
    "m_ObjectId": "c548ef7607014e0da7a8e20ba3e418e9",
    "m_Datas": [],
    "m_ActiveSubTarget": {
        "m_Id": "081930db40d3417eaa49d6e6df667383"
    },
    "m_AllowMaterialOverride": false,
    "m_SurfaceType": 1,
    "m_ZTestMode": 4,
    "m_ZWriteControl": 0,
    "m_AlphaMode": 0,
    "m_RenderFace": 2,
    "m_AlphaClip": false,
    "m_CastShadows": false,
    "m_ReceiveShadows": true,
    "m_DisableTint": false,
    "m_AdditionalMotionVectorMode": 0,
    "m_AlembicMotionVectors": false,
    "m_SupportsLODCrossFade": false,
    "m_CustomEditorGUI": "",
    "m_SupportVFX": false
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
    "m_ObjectId": "c757e87eb2644e24af9f6585b74fa524",
    "m_Id": 2,
    "m_DisplayName": "Out",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Out",
    "m_StageCapability": 3,
    "m_Value": {
        "e00": 0.0,
        "e01": 0.0,
        "e02": 0.0,
        "e03": 0.0,
        "e10": 0.0,
        "e11": 0.0,
        "e12": 0.0,
        "e13": 0.0,
        "e20": 0.0,
        "e21": 0.0,
        "e22": 0.0,
        "e23": 0.0,
        "e30": 0.0,
        "e31": 0.0,
        "e32": 0.0,
        "e33": 0.0
    },
    "m_DefaultValue": {
        "e00": 1.0,
        "e01": 0.0,
        "e02": 0.0,
        "e03": 0.0,
        "e10": 0.0,
        "e11": 1.0,
        "e12": 0.0,
        "e13": 0.0,
        "e20": 0.0,
        "e21": 0.0,
        "e22": 1.0,
        "e23": 0.0,
        "e30": 0.0,
        "e31": 0.0,
        "e32": 0.0,
        "e33": 1.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "ca2f6195da984047a45d29dd06c85252",
    "m_Id": 3,
    "m_DisplayName": "World Bounds Max",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "World Bounds Max",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
    "m_ObjectId": "cf8ac88182a54394afb4615ded88792e",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Property",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -528.0000610351563,
            "y": 546.0000610351563,
            "width": 127.0,
            "height": 34.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "8646b417f10347659a9a484473211a50"
        }
    ],
    "synonyms": [],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_Property": {
        "m_Id": "85672431213548ca8a0ef8bc5f543d8c"
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "d140504a1d4845c4b26d679530527aa3",
    "m_Id": 3,
    "m_DisplayName": "Near Plane",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Near Plane",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.RotateAboutAxisNode",
    "m_ObjectId": "d31479c4d4c64b049755104be6939c44",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Rotate About Axis",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -353.0,
            "y": 41.0,
            "width": 164.0,
            "height": 177.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "11c6a4fd998645218cee336bbfcb2edc"
        },
        {
            "m_Id": "46541f5acf8a49fea801a78356bc6585"
        },
        {
            "m_Id": "efc585a05a5247d08bcff0cddff0a175"
        },
        {
            "m_Id": "53e7f127466a428b81bb735c2cc7d722"
        }
    ],
    "synonyms": [
        "pivot"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_Unit": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "d93c661cb8f243989ae22262b9cfef8b",
    "m_Id": 2,
    "m_DisplayName": "G",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "G",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
    "m_ObjectId": "deab0ef59ea843108483c8287cdc51d0",
    "m_Id": 0,
    "m_DisplayName": "Position",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Position",
    "m_StageCapability": 1,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": [],
    "m_Space": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.BlockNode",
    "m_ObjectId": "e01343c4cdb845dcb252212877f70ee4",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "SurfaceDescription.Alpha",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": 0.0,
            "y": 0.0,
            "width": 0.0,
            "height": 0.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "8a6a45a286a54da6948c21d7f57e172c"
        }
    ],
    "synonyms": [],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    },
    "m_SerializedDescriptor": "SurfaceDescription.Alpha"
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "e2bdfd6f3ae4408391020d3d82437d5a",
    "m_Id": 7,
    "m_DisplayName": "Height",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Height",
    "m_StageCapability": 3,
    "m_Value": 1.0,
    "m_DefaultValue": 1.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.SplitNode",
    "m_ObjectId": "e32470a4c1ba4209826e24682298701c",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Split",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -669.0,
            "y": -28.0,
            "width": 120.0,
            "height": 149.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "17234cae634b4599bc55b9e1f568a9e0"
        },
        {
            "m_Id": "f4e346df623c4eb28f34f7e4a541de3a"
        },
        {
            "m_Id": "d93c661cb8f243989ae22262b9cfef8b"
        },
        {
            "m_Id": "b2be4eb8902e423dac8fc9557eae894b"
        },
        {
            "m_Id": "2da8c8085d9b4bcc8ddcfb7e64076d8c"
        }
    ],
    "synonyms": [
        "separate"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": true,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "e4341a2a112347e89e6a8a1a1f722075",
    "m_Id": 0,
    "m_DisplayName": "Position",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Position",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
    "m_ObjectId": "e5089fcc9fda4f17988359022363b0bd",
    "m_Id": 0,
    "m_DisplayName": "In",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "In",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "e729fee4b268475f992824482ea4747d",
    "m_Id": 6,
    "m_DisplayName": "Width",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "Width",
    "m_StageCapability": 3,
    "m_Value": 1.0,
    "m_DefaultValue": 1.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "e9114e90211c42a4a483a6ef1c3010a3",
    "m_Id": 7,
    "m_DisplayName": "A",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "A",
    "m_StageCapability": 2,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.MultiplyNode",
    "m_ObjectId": "eb63323c6b5d49feacc5978986facc6f",
    "m_Group": {
        "m_Id": ""
    },
    "m_Name": "Multiply",
    "m_DrawState": {
        "m_Expanded": true,
        "m_Position": {
            "serializedVersion": "2",
            "x": -518.0,
            "y": -277.0,
            "width": 130.0,
            "height": 118.0
        }
    },
    "m_Slots": [
        {
            "m_Id": "4bc7038d56c84ff6aea7a85b048ecca1"
        },
        {
            "m_Id": "7ce3ac7090b241ca988dd8882bfb7947"
        },
        {
            "m_Id": "c757e87eb2644e24af9f6585b74fa524"
        }
    ],
    "synonyms": [
        "multiplication",
        "times",
        "x"
    ],
    "m_Precision": 0,
    "m_PreviewExpanded": false,
    "m_DismissedVersion": 0,
    "m_PreviewMode": 0,
    "m_CustomColors": {
        "m_SerializableColors": []
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
    "m_ObjectId": "ed1ade71b4d24ff2a85eaba521accd74",
    "m_Id": 0,
    "m_DisplayName": "RGBA",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "RGBA",
    "m_StageCapability": 2,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
    "m_ObjectId": "ef119d9737b248aab2997c014c8e18bc",
    "m_Id": 0,
    "m_DisplayName": "Tangent",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Tangent",
    "m_StageCapability": 1,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
    },
    "m_Labels": [],
    "m_Space": 0
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "efc585a05a5247d08bcff0cddff0a175",
    "m_Id": 2,
    "m_DisplayName": "Rotation",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Rotation",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    "m_ObjectId": "f4d09c507d224a19b74f7bf633725fd1",
    "m_Id": 0,
    "m_DisplayName": "A",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "A",
    "m_StageCapability": 3,
    "m_Value": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "m_DefaultValue": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    }
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
    "m_ObjectId": "f4e346df623c4eb28f34f7e4a541de3a",
    "m_Id": 1,
    "m_DisplayName": "R",
    "m_SlotType": 1,
    "m_Hidden": false,
    "m_ShaderOutputName": "R",
    "m_StageCapability": 3,
    "m_Value": 0.0,
    "m_DefaultValue": 0.0,
    "m_Labels": []
}

{
    "m_SGVersion": 0,
    "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot",
    "m_ObjectId": "faf7b6f99c4b45e0bd4c1177b132b340",
    "m_Id": 3,
    "m_DisplayName": "Sampler",
    "m_SlotType": 0,
    "m_Hidden": false,
    "m_ShaderOutputName": "Sampler",
    "m_StageCapability": 3,
    "m_BareResource": false
}


I need to use a job for this, so I can’t do regular mono behaviors. Here’s an example, that does not work.

[BurstCompile]
public partial struct SpriteBillboardJob : IJobEntity
{
    public float3 CameraLocation;
    public quaternion CameraRotation;

    [BurstCompile]
    private void Execute(ref LocalToWorld localToWorld, ref LocalTransform localTransform, SpriteBillboardTag spt)
    {
        localTransform.Rotation = Quaternion.FromToRotation(localTransform.Up(), localToWorld.Up);
    }
}

Wow! Thanks Andrew, you’re an absolute god!! I didn’t look into the shader solution yet, but I’ll definitely look into that since I’ve heard that it’s a lot performant for this kind of feature.

Wanted to note out that, I had to disable the WoldSystemFilter(s) for some reason. Might be that my game project file is wonky, but it’s alright for now!

Thanks again, I’ve been at this for weeks and couldn’t figure out transform matrix updating :melting_face:

Thanks for the third time!!

Good call and your project is fine. This particular WorldSystemFilter attribute setup makes this system run both in and out of play mode. This is the usual one:

[WorldSystemFilter( WorldSystemFilterFlags.Default | WorldSystemFilterFlags.Editor )]

And this is for Netcode-for-ECS projects:

[WorldSystemFilter( WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.Editor )]

So my bad as I totally forgot to mention it.

Oh right yeah, I remember seeing something about the Netcode-for-ECS filters in this video: https://www.youtube.com/watch?v=8efRGtRCGJ0 I'll probably need that way later in my project, but good to know before hand. Thanks for clearing that up!