Class PolySpatialShaderGlobals
Provides static functions to set global shader properties and transfer the updated values to the renderer via PolySpatial.
Inherited Members
Namespace: Unity.PolySpatial
Assembly: Unity.PolySpatial.dll
Syntax
public static class PolySpatialShaderGlobals
Fields
AmbientEquatorColor
The name of the global shader property that represents the ambient equator parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string AmbientEquatorColor = "unity_AmbientEquator"
Field Value
Type | Description |
---|---|
string |
AmbientGroundColor
The name of the global shader property that represents the ambient ground parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string AmbientGroundColor = "unity_AmbientGround"
Field Value
Type | Description |
---|---|
string |
AmbientSkyColor
The name of the global shader property that represents the ambient sky parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string AmbientSkyColor = "unity_AmbientSky"
Field Value
Type | Description |
---|---|
string |
CosTime
The name of the global shader property that represents the cosine of time since level load (t/8, t/4, t/2, t).
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string CosTime = "_CosTime"
Field Value
Type | Description |
---|---|
string |
DeltaTime
The name of the global shader property that represents the time delta (dt, 1/dt, smoothDt, 1/smoothDt).
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string DeltaTime = "unity_DeltaTime"
Field Value
Type | Description |
---|---|
string |
FogColor
The name of the global shader property that represents the fog color.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string FogColor = "unity_FogColor"
Field Value
Type | Description |
---|---|
string |
FogParams
The name of the global shader property that represents the fog parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string FogParams = "unity_FogParams"
Field Value
Type | Description |
---|---|
string |
GlossyEnvironmentColor
The name of the global shader property that represents the glossy environment color.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string GlossyEnvironmentColor = "polySpatial_GlossyEnvironmentColor"
Field Value
Type | Description |
---|---|
string |
LightAttenPrefix
The name of the global shader property that represents the light attenuation.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string LightAttenPrefix = "polySpatial_LightAtten"
Field Value
Type | Description |
---|---|
string |
LightColorPrefix
The name of the global shader property that represents the light color.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string LightColorPrefix = "polySpatial_LightColor"
Field Value
Type | Description |
---|---|
string |
LightCount
The number of lights that can be accounted for in a ShaderGraph converted into MaterialX.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const int LightCount = 4
Field Value
Type | Description |
---|---|
int |
LightPositionPrefix
The name of the global shader property that represents the light position.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string LightPositionPrefix = "polySpatial_LightPosition"
Field Value
Type | Description |
---|---|
string |
OrthoParams
The name of the global shader property that represents the orthographic camera parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string OrthoParams = "unity_OrthoParams"
Field Value
Type | Description |
---|---|
string |
ProjectionMatrix
The name of the global shader property that represents the camera's projection matrix.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string ProjectionMatrix = "UNITY_MATRIX_P"
Field Value
Type | Description |
---|---|
string |
ProjectionParams
The name of the global shader property that represents the camera's projection parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string ProjectionParams = "_ProjectionParams"
Field Value
Type | Description |
---|---|
string |
ScreenParams
The name of the global shader property that represents the screen parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string ScreenParams = "_ScreenParams"
Field Value
Type | Description |
---|---|
string |
SinTime
The name of the global shader property that represents the sine of time since level load (t/8, t/4, t/2, t).
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string SinTime = "_SinTime"
Field Value
Type | Description |
---|---|
string |
SpotDirectionPrefix
The name of the global shader property that represents the light direction.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string SpotDirectionPrefix = "polySpatial_SpotDirection"
Field Value
Type | Description |
---|---|
string |
Time
The name of the global shader property that represents time since level load (t/20, t, t2, t3).
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string Time = "_Time"
Field Value
Type | Description |
---|---|
string |
ViewMatrix
The name of the global shader property that represents the orthographic camera parameters.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string ViewMatrix = "UNITY_MATRIX_V"
Field Value
Type | Description |
---|---|
string |
WorldSpaceCameraDir
The name of the global shader property that represents the world space camera direction.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string WorldSpaceCameraDir = "_WorldSpaceCameraDir"
Field Value
Type | Description |
---|---|
string |
WorldSpaceCameraPos
The name of the global shader property that represents the world space camera position.
Declaration
[Obsolete("This property will be removed in PolySpatial 2.0.")]
public const string WorldSpaceCameraPos = "_WorldSpaceCameraPos"
Field Value
Type | Description |
---|---|
string |
Methods
SetColor(string, Color)
Sets the value of a color shader global and adds it to the list of globals to transfer via PolySpatial.
Declaration
public static void SetColor(string name, Color value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the shader global to set. |
Color | value | The new value for the shader global. |
SetFloat(string, float)
Sets the value of a float shader global and adds it to the list of globals to transfer via PolySpatial.
Declaration
public static void SetFloat(string name, float value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the shader global to set. |
float | value | The new value for the shader global. |
SetInteger(string, int)
Sets the value of an integer shader global and adds it to the list of globals to transfer via PolySpatial.
Declaration
public static void SetInteger(string name, int value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the shader global to set. |
int | value | The new value for the shader global. |
SetMatrix(string, Matrix4x4)
Sets the value of a matrix shader global and adds it to the list of globals to transfer via PolySpatial.
Declaration
public static void SetMatrix(string name, Matrix4x4 value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the shader global to set. |
Matrix4x4 | value | The new value for the shader global. |
SetTexture(string, Texture)
Sets the value of a texture shader global and adds it to the list of globals to transfer via PolySpatial.
Declaration
public static void SetTexture(string name, Texture value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the shader global to set. |
Texture | value | The new value for the shader global. |
SetVector(string, Vector4)
Sets the value of a vector shader global and adds it to the list of globals to transfer via PolySpatial.
Declaration
public static void SetVector(string name, Vector4 value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the shader global to set. |
Vector4 | value | The new value for the shader global. |
TryAdd(string, PropertyType)
Attempts to add a property to the list of shader globals to transfer via PolySpatial.
Declaration
public static bool TryAdd(string name, PolySpatialShaderGlobals.PropertyType type)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the shader global to add. |
PolySpatialShaderGlobals.PropertyType | type | The type of the shader global. |
Returns
Type | Description |
---|---|
bool | True if added or already present with the same type, false if already present with a different type (in which case an error will be logged). |