Unity PolySpatial Shader Graph Support
You can use the Unity Shader Graph to create custom materials for visionOS. These will previewed in their compiled form within Unity, but converted to MaterialX for display in simulator and on device. While MaterialX is very expressive, some Shader Graph nodes have no analog in materialX. Within the Shader Graph editor, unsupported nodes will be indicated by the presence of a #
symbol.
For technical, security, and privacy reasons, visionOS does not allow Metal-based shaders or other low level shading languages to run when using AR passthrough.
Texture Limitations
When sampling textures in shader graphs, note that the sampler state (filter, wrap modes) associated with the texture itself is ignored. Instead, you must use the Sampler State
node to control how the texture is sampled if you want to use a mode other than the default (linear filtering, repeat wrap mode).
Shader Graph Nodes
The following tables show the current support status for Shader Graph nodes in PolySpatial for visionOS including a list of supported nodes and their various caveats.
If a node doesn't appear here it means that it's not currently supported. Note that this list will be updated as we continue to add support for more nodes.
Artistic
Section | Node | Notes |
---|---|---|
Adjustment | Channel Mixer | ✓ Supported |
Contrast | ✓ Supported | |
Hue | ✓ Supported | |
Invert Colors | ✓ Supported | |
Replace Color | ✓ Supported | |
Saturation | ✓ Supported | |
White Balance | ✓ Supported | |
Blend | Blend | ✓ Supported |
Filter | Fade Transition | ✓ Supported |
Mask | Channel Mask | ✓ Supported |
Color Mask | ✓ Supported | |
Normal | Normal Blend | ✓ Supported |
Normal From Height | ✓ Supported | |
Normal Reconstruct Z | ✓ Supported | |
Normal Strength | ✓ Supported | |
Normal Unpack | ✓ Supported | |
Utility | Colorspace Conversion | ✓ Supported |
Channel
Section | Node | Notes |
---|---|---|
Channel | Combine | ✓ Supported |
Flip | ✓ Supported | |
Split | ✓ Supported | |
Swizzle | ✓ Supported |
Input
Custom Interpolators
are limited to these specific/names types:
Color
: Vector4UV0
: Vector2UV1
: Vector2UserAttribute
: Vector4Section Node Notes Basic Boolean ✓ Supported Color ✓ Supported Constant ✓ Supported Integer ✓ Supported Slider ✓ Supported Time ✓ Supported Float ✓ Supported Vector2 ✓ Supported Vector3 ✓ Supported Vector4 ✓ Supported Geometry Bitangent Vector Tangent and View space options are not standard. Normal Vector Tangent and View space options are not standard. Position Tangent and View space options are not standard. Screen Position ✓ Supported Tangent Vector Tangent and View space options are not standard. UV ✓ Supported Vertex Color ✓ Supported Vertex ID ✓ Supported View Direction ✓ Supported Gradient Gradient ✓ Supported Sample Gradient ✓ Supported Lighting Main Light Direction ✓ Supported Matrix Matrix 2x2 ✓ Supported Matrix 3x3 ✓ Supported Matrix 4x4 ✓ Supported Transformation Matrix Tangent and View space options are not standard. PBR Metal Reflectance ✓ Supported Scene Camera Position
andDirection
outputs supported (non-standard).Eye Index ✓ Supported Object ✓ Supported Scene Depth Platform doesn't allow have access to the depth buffer, this is just the camera distance in either clip or view space. Screen ✓ Supported Texture Cubemap Asset ✓ Supported Sample Cubemap ✓ Supported Sample Reflected Cubemap ✓ Supported Sample Texture 2D ✓ Supported Sample Texture 2D LOD ✓ Supported Sample Texture 3D ✓ Supported Sampler State MirrorOnce
wrap mode not supported.Texture 2D Asset ✓ Supported Texture 3D Asset ✓ Supported Texture Size ✓ Supported
Math
Section | Node | Notes |
---|---|---|
Advanced | Absolute | ✓ Supported |
Exponential | ✓ Supported | |
Length | ✓ Supported | |
Log | ✓ Supported | |
Modulo | ✓ Supported | |
Negate | ✓ Supported | |
Normalize | ✓ Supported | |
Posterize | ✓ Supported | |
Reciprocal | ✓ Supported | |
Reciprocal Square Root | ✓ Supported | |
Basic | Add | ✓ Supported |
Divide | ✓ Supported | |
Multiply | ✓ Supported | |
Power | ✓ Supported | |
Square Root | ✓ Supported | |
Subtract | ✓ Supported | |
Interpolation | Inverse Lerp | ✓ Supported |
Lerp | ✓ Supported | |
Smoothstep | ✓ Supported | |
Matrix | Matrix Construction | ✓ Supported |
Matrix Determinant | ✓ Supported | |
Matrix Split | ✓ Supported | |
Matrix Transpose | ✓ Supported | |
Range | Clamp | ✓ Supported |
Fraction | ✓ Supported | |
Maximum | ✓ Supported | |
Minimum | ✓ Supported | |
One Minus | ✓ Supported | |
Random Range | ✓ Supported | |
Remap | ✓ Supported | |
Saturate | ✓ Supported | |
Round | Ceiling | ✓ Supported |
Floor | ✓ Supported | |
Round | ✓ Supported | |
Sign | ✓ Supported | |
Step | ✓ Supported | |
Truncate | ✓ Supported | |
Trigonometry | Arccosine | ✓ Supported |
Arcsine | ✓ Supported | |
Arctangent | ✓ Supported | |
Arctangent2 | ✓ Supported | |
Cosine | ✓ Supported | |
Degrees to Radians | ✓ Supported | |
Hyperbolic Cosine | ✓ Supported | |
Hyperbolic Sine | ✓ Supported | |
Hyperbolic Tangent | ✓ Supported | |
Radians to Degrees | ✓ Supported | |
Sine | ✓ Supported | |
Tangent | ✓ Supported | |
Vector | Cross Product | ✓ Supported |
Distance | ✓ Supported | |
Dot Product | ✓ Supported | |
Fresnel Effect | ✓ Supported | |
Projection | ✓ Supported | |
Reflection | ✓ Supported | |
Rejection | ✓ Supported | |
Rotate About Axis | ✓ Supported | |
Sphere Mask | ✓ Supported | |
Transform | Some spaces are simulated and not covered in tests. | |
Wave | Noise Sine Wave | ✓ Supported |
Sawtooth Wave | ✓ Supported | |
Square Wave | ✓ Supported | |
Triangle Wave | ✓ Supported |
Procedural
Section | Node | Notes |
---|---|---|
Noise | Gradient Noise | - Can't be certain that target platform noise functions will behave the same. - Frequency is currently off (scale is mapped to amplitude rather than frequency). |
Voronoi | - Can't be certain that target platform noise functions will behave the same. | |
Shapes | Ellipse | ✓ Supported |
Polygon | ✓ Supported | |
Rectangle | ✓ Supported |
Utility
Section | Node | Notes |
---|---|---|
Utility | Custom Function | See custom function node conversion notes. |
PolySpatial Lighting | See lighting notes. | |
Preview | ✓ Supported | |
Split LR | Non-standard shader graph node specific to PolySpatial. Implements the splitlr function as described in the MaterialX Spec. | |
Logic | Branch | ✓ Supported |
Comparison | ✓ Supported | |
Is Infinite | ✓ Supported | |
Is NaN | ✓ Supported | |
Or | ✓ Supported |
UV
Section | Node | Notes |
---|---|---|
UV | Flipbook | ✓ Supported |
Polar Coordinates | ✓ Supported | |
Radial Shear | ✓ Supported | |
Rotate | Only Degrees are supported. | |
Spherize | ✓ Supported | |
Tiling and Offset | ✓ Supported | |
Triplanar | ✓ Supported | |
Twirl | ✓ Supported |