<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/random",
  "metadataVersion" : "0.1.0",
  "role" : "Namespace",
  "symbol" : {
    "kind" : "Namespace",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "random"
  },
  "title" : "random"
}
-->

# random

Nodes for generating pseudo-random numbers.

## Topics

### Functions

[`float2 random::float2_01()`](/documentation/ComputeGraph/random/float2_01)

Generates a pseudo-random 2D vector with single-precision components between 0 and 1.

[`float2 random::float2_01_using(seed)`](/documentation/ComputeGraph/random/float2_01_using)

Generates a pseudo-random 2D vector with single-precision components between 0 and 1 using a specific seed.

[`float3 random::float3_01()`](/documentation/ComputeGraph/random/float3_01)

Generates a pseudo-random 3D vector with single-precision components between 0 and 1.

[`float3 random::float3_01_using(seed)`](/documentation/ComputeGraph/random/float3_01_using)

Generates a pseudo-random 3D vector with single-precision components between 0 and 1 using a specific seed.

[`float4 random::float4_01()`](/documentation/ComputeGraph/random/float4_01)

Generates a pseudo-random 4D vector with single-precision components between 0 and 1.

[`float4 random::float4_01_using(seed)`](/documentation/ComputeGraph/random/float4_01_using)

Generates a pseudo-random 4D vector with single-precision components between 0 and 1 using a specific seed.

[`float random::float_01()`](/documentation/ComputeGraph/random/float_01)

Generates a pseudo-random single-precision float between 0 and 1.

[`float random::float_01_using(seed)`](/documentation/ComputeGraph/random/float_01_using)

Generates a pseudo-random single-precision float between 0 and 1 using a specific seed.

[`half2 random::half2_01()`](/documentation/ComputeGraph/random/half2_01)

Generates a pseudo-random 2D vector with half-precision components between 0 and 1.

[`half2 random::half2_01_using(seed)`](/documentation/ComputeGraph/random/half2_01_using)

Generates a pseudo-random 2D vector with half-precision components between 0 and 1 using a specific seed.

[`half3 random::half3_01()`](/documentation/ComputeGraph/random/half3_01)

Generates a pseudo-random 3D vector with half-precision components between 0 and 1.

[`half3 random::half3_01_using(seed)`](/documentation/ComputeGraph/random/half3_01_using)

Generates a pseudo-random 3D vector with half-precision components between 0 and 1 using a specific seed.

[`half4 random::half4_01()`](/documentation/ComputeGraph/random/half4_01)

Generates a pseudo-random 4D vector with half-precision components between 0 and 1.

[`half4 random::half4_01_using(seed)`](/documentation/ComputeGraph/random/half4_01_using)

Generates a pseudo-random 4D vector with half-precision components between 0 and 1 using a specific seed.

[`half random::half_01()`](/documentation/ComputeGraph/random/half_01)

Generates a pseudo-random half-precision float between 0 and 1.

[`half random::half_01_using(seed)`](/documentation/ComputeGraph/random/half_01_using)

Generates a pseudo-random half-precision float between 0 and 1 using a specific seed.

[`uint random::integer()`](/documentation/ComputeGraph/random/integer)

Generates a pseudo-random 32-bit unsigned integer.

[`uint random::integer_using(seed)`](/documentation/ComputeGraph/random/integer_using)

Generates a pseudo-random 32-bit unsigned integer using a specific seed.

[`uint random::seed()`](/documentation/ComputeGraph/random/seed)

Returns the current random seed, without incrementing it.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)