class in UnityEngine.Experimental.Rendering
/
Inherits from:Object
/
Implemented in:UnityEngine.CoreModule
Collection of shader variants and associated graphics states.
Use graphics state collections to record shader variants and graphics states encountered at runtime and prewarm shader variants.
Each shader variant in the collection may have one or more associated graphics states. Each permutation of a shader variant and a graphics state will result in a single GPU representation of the shader being created by Unity.
using UnityEngine; using UnityEngine.Experimental.Rendering;
public class GraphicsStateCollectionTracing : MonoBehaviour { public GraphicsStateCollection graphicsStateCollection;
void Start() { graphicsStateCollection = new GraphicsStateCollection(); graphicsStateCollection.BeginTrace(); }
void OnDestroy() { graphicsStateCollection.EndTrace(); } }
completedWarmupCount | The number of shader variant permutations that have been warmed up. |
graphicsDeviceType | The graphics device API type the collection is intended to be used with. |
isTracing | Flag indicating if the collection is actively tracing shader variants and graphics states. |
isWarmedUp | Flag indicating if the collection is warmed up. |
qualityLevelName | The quality level the collection is intended to be used with. |
runtimePlatform | The platform that the collection is intended to be used with. |
totalGraphicsStateCount | The total number of graphics states across all shader variants in the collection. |
variantCount | The number of shader variants contained in this collection. |
version | The current version of the collection. |
GraphicsStateCollection | Create a GraphicsTextureCollection populated with contents of a file, or empty. |
AddGraphicsStateForVariant | Adds a new graphics state associated with a shader variant. |
AddVariant | Adds a new shader variant to the collection. |
BeginTrace | Start tracing shader variants and graphics states encountered at runtime. |
ClearVariants | Clears all shader variants and associated graphics states from collection. |
ContainsVariant | Check if variant exists in collection. |
EndTrace | Stop tracing shader variants and graphics states encountered at runtime. |
GetGraphicsStateCountForVariant | Get the number of graphics states associated to a shader variant. |
GetGraphicsStatesForVariant | Populate given list with graphics states associated with input shader variant. |
GetVariants | Populate given list with shader variants contained in collection. |
LoadFromFile | Load the GraphicsStateCollection at the given path. |
RemoveGraphicsStatesForVariant | Remove all associated graphics states from a shader variant. |
RemoveVariant | Remove shader variant and associated graphics states from collection. |
SaveToFile | Save GraphicsStateCollection to disk. |
SendToEditor | Send GraphicsStateCollection to the Editor using PlayerConnection. |
WarmUp | Prewarms all shader variants in this collection using associated graphics states. |
WarmUpProgressively | Prewarms the given number of shader variant permutations using associated graphics states. |
hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
name | The name of the object. |
GetInstanceID | Gets the instance ID of the object. |
ToString | Returns the name of the object. |
Destroy | Removes a GameObject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Do not destroy the target Object when loading a new Scene. |
FindAnyObjectByType | Retrieves any active loaded object of Type type. |
FindFirstObjectByType | Retrieves the first active loaded object of Type type. |
FindObjectsByType | Retrieves a list of all loaded objects of Type type. |
Instantiate | Clones the object original and returns the clone. |
InstantiateAsync | Captures a snapshot of the original object (that must be related to some GameObject) and returns the AsyncInstantiateOperation. |
bool | Does the object exist? |
operator != | Compares if two objects refer to a different object. |
operator == | Compares two object references to see if they refer to the same object. |