| Parameter | Description |
|---|---|
| platform | The target platform to check. Use UnityEditor.EditorUserBuildSettings.activeBuildTarget to specify the current Build target. |
| checkGraphicsApisList | Set to true to check the graphics API list in the Player settings. |
RayTracingFeatureFlags A list of flags that represent ray tracing features that the target platform supports.
Gets the ray tracing features that the specified target platform supports.
If checkGraphicsApisList is true, 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.
Additional 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.