Version: 2022.2
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

RayTracingInstanceMaterialConfig

struct in UnityEngine.Experimental.Rendering

/

Implemented in:UnityEngine.CoreModule

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

Description

This structure is used by RayTracingAccelerationStructure.CullInstances function to determine which types of Materials are used by Renderers when populating the acceleration structure with ray tracing instances.

RayTracingAccelerationStructure.CullInstances function can ignore Renderers or sub-meshes that use different types of Materials as defined by this configuration. RayTracingInstanceCullingConfig parameter contains one Material configuration for alpha tested Materials and one for transparent Materials. If a Material is not classified as transparent or alpha tested then is considered being opaque.

The Material type is defined by testing one of the following properties:

  • The render queue value used by the Shader or the one overriden by the Material using the Shader (see Shader.renderQueue and Material.renderQueue). The value of the render queue has to be between renderQueueLowerBound and renderQueueUpperBound interval including these two values.
  • An optional Shader Tag (e.g. Tags { "RenderType"="Transparent" }). The Shader used by a Material has to contain a Shader Tag from optionalShaderTags array.
  • An optional Shader Keyword (e.g. #pragma shader_feature_local _ALPHATEST_ON). A Shader Keyword from optionalShaderKeywords array has to be enabled at the time when RayTracingAccelerationStructure.CullInstances is called.

See Also: RayTracingInstanceCullingTest, RayTracingAccelerationStructure.

Properties

optionalShaderKeywordsAn array of Shader Keyword names used to determine the Material type.
optionalShaderTagsAn array of Shader Tags used to determine the Material type.
renderQueueLowerBoundThe lower limit of a render queue interval.
renderQueueUpperBoundThe upper limit of a render queue interval.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961