Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

GraphicsStateCollection.AddGraphicsStatesFromReference

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Boolean AddGraphicsStatesFromReference(UnityEngine.Experimental.Rendering.GraphicsStateCollection/GraphicsState refState, Mesh[] meshes, Material[] materials, Int32 samples, Unity.Collections.NativeArray<UnityEngine.Rendering.AttachmentDescriptor> attachments, Unity.Collections.NativeArray<UnityEngine.Rendering.SubPassDescriptor> subPasses, Int32 subPassIndex = 0, Int32 depthAttachmentIndex = -1, Int32 shadingRateIndex = -1);

Declaration

public Boolean AddGraphicsStatesFromReference(UnityEngine.Experimental.Rendering.GraphicsStateCollection/GraphicsState refState, Mesh[] meshes, Material[] materials, UnityEngine.Rendering.GlobalKeyword[] globalKeywords, Int32 samples, Unity.Collections.NativeArray<UnityEngine.Rendering.AttachmentDescriptor> attachments, Unity.Collections.NativeArray<UnityEngine.Rendering.SubPassDescriptor> subPasses, Int32 subPassIndex = 0, Int32 depthAttachmentIndex = -1, Int32 shadingRateIndex = -1);

Parameters

Parameter Description
refState The reference GraphicsState to use as a template for initializing unspecified values.
meshes An array of meshes to generate graphics states from. This array must be the same length as the materials array.
materials An array of materials specifying the shader variant(s) for each generated graphics state. This array must be the same length as the meshes array.
vfxAssets An array of VisualEffectAsset objects to scan for each set of unique mesh and shader pairs.
globalKeywords An array of GlobalKeyword objects to use in conjunction with each material's enabled keywords when generating shader variants.
samples The number of samples per pixel in this rendering configuration.
attachments The array of color attachments used in this rendering configuration.
subPasses The array containing information of each subpass.
subPassIndex The index of the active subpass in this rendering configuration.
depthAttachmentIndex The index of the attachment to be used as the depth/stencil buffer for this rendering configuration.
shadingRateIndex The index of the attachment to be used as the shading rate image for this rendering configuration.

Returns

Boolean True if at least one new graphics state was successfully added, false otherwise.

Description

Generates and adds new graphics states from arrays of assets, using a reference graphics state to initialize unspecified values.

This function operates like AddGraphicsStates, but instead of using default values for GraphicsState fields, it copies values from the provided refState for any fields not determined by the input parameters. Additional resources: AddGraphicsStates, AddGraphicsStateForVariant, CommandBuffer.BeginRenderPass.