A game about forced loneliness, made by TACStudios
1# Object Node 2 3## Description 4 5Provides access to various parameters of the currently rendering **Object**. 6 7Note: The behaviour of the Position [Port](Port.md) can be defined per Render Pipeline. Different Render Pipelines may produce different results. If you're building a shader in one Render Pipeline that you want to use in both, try checking it in both pipelines before production. 8 9#### Unity Render Pipelines Support 10- Universal Render Pipeline 11- High Definition Render Pipeline 12 13## Ports 14 15| Name | Direction | Type | Binding | Description | 16|:------------ |:-------------|:-----|:---|:---| 17| Position | Output | Vector 3 | None | Object position in world space | 18| Scale | Output | Vector 3 | None | Object scale in world space | 19| World Bounds Min | Output | Vector 3 | None | Minimum value of the renderer bounds in world space | 20| World Bounds Max | Output | Vector 3 | None | Maximum value of the renderer bounds in world space | 21| Bounds Size | Output | Vector 3 | None | Size of the renderer bounds | 22 23Note: the bounds values are the equivalent of [the bounds in the renderer component](https://docs.unity3d.com/ScriptReference/Renderer-bounds.html). This means that vertex deformation done in ShaderGraph doesn't affect these values. 24 25## Generated Code Example 26 27The following example code represents one possible outcome of this node. 28 29``` 30float3 _Object_Position = SHADERGRAPH_OBJECT_POSITION; 31float3 _Object_Scale = float3(length(float3(UNITY_MATRIX_M[0].x, UNITY_MATRIX_M[1].x, UNITY_MATRIX_M[2].x)), 32 length(float3(UNITY_MATRIX_M[0].y, UNITY_MATRIX_M[1].y, UNITY_MATRIX_M[2].y)), 33 length(float3(UNITY_MATRIX_M[0].z, UNITY_MATRIX_M[1].z, UNITY_MATRIX_M[2].z))); 34float3 _Object_WorldBoundsMin = SHADERGRAPH_RENDERER_BOUNDS_MIN; 35float3 _Object_WorldBoundsMax = SHADERGRAPH_RENDERER_BOUNDS_MAX; 36float3 _Object_BoundsSize = (SHADERGRAPH_RENDERER_BOUNDS_MAX - SHADERGRAPH_RENDERER_BOUNDS_MIN); 37```