GetRayTracingFeaturesSupportForPlatform(BuildTarget, bool)
Gets the ray tracing features that the specified target platform supports.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public static RayTracingFeatureFlags GetRayTracingFeaturesSupportForPlatform(BuildTarget platform, bool checkGraphicsApisList)
Parameters
The target platform to check. Use EditorUserBuildSettings.activeBuildTarget to specify the current Build target.
Set to to check the graphics API list in the Player settings.
trueReturns
Type | Description |
|---|---|
| RayTracingFeatureFlags | A list of flags that represent ray tracing features that the target platform supports. |
Remarks
If is , this method checks the graphics API list configured in the Player settings for the given platform. If none of the graphics APIs support a specific ray tracing feature, no flags are returned.
checkGraphicsApisListtrueAdditional Resources: RayTracingFeatureFlags.
using UnityEngine;using UnityEditor;public class CheckRayTracingFeatures : MonoBehaviour{ void Start() { BuildTarget buildTarget = UnityEditor.EditorUserBuildSettings.activeBuildTarget; RayTracingFeatureFlags features = PlayerSettings.GetRayTracingFeaturesSupportForPlatform(buildTarget, true); Debug.Log("Checking target platform " + buildTarget + " for ray tracing features."); if (features == RayTracingFeatureFlags.None) { Debug.Log("The target platform doesn't support any ray tracing features."); } else { if ((features & RayTracingFeatureFlags.InlineRayTracing) != 0) Debug.Log("The target platform supports Inline Ray Tracing."); if ((features & RayTracingFeatureFlags.RayTracingShaders) != 0) Debug.Log("The target platform supports Ray Tracing Shaders."); } }}
The example above checks and reports any ray tracing features supported by the active build target platform.