# BuildProfileGraphicsSettings

> A build profile component that overrides the global graphics settings.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.Build.Profile](/engine/7000.0/script-reference/unityeditor/build/profile.md)
* **Assembly:** UnityEditor.CoreModule
* **Inherits from:** [ScriptableObject](/engine/7000.0/script-reference/unityengine/scriptableobject.md)

```csharp
[ExcludeFromObjectFactory]
public sealed class BuildProfileGraphicsSettings : ScriptableObject
```

## Remarks

To add these settings to a build profile, use [BuildProfile.CreateComponent](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofile/createcomponent.md). To remove them, use [BuildProfile.RemoveComponent](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofile/removecomponent.md).

When the build profile is the active build profile, its values replace the matching values in the global graphics settings. Each corresponding [GraphicsSettings](/engine/7000.0/script-reference/unityengine/rendering/graphicssettings.md) property returns the build profile's value, and [EditorGraphicsSettings.GetShaderBuildSettings](/engine/7000.0/script-reference/unityeditor/rendering/editorgraphicssettings/getshaderbuildsettings.md) returns [BuildProfileGraphicsSettings.shaderBuildSettings](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofilegraphicssettings/shaderbuildsettings.md).

The following example gives the active build profile its own graphics settings, and then makes Unity log shader compilation for that build profile only.

```csharp
using UnityEditor;
using UnityEditor.Build.Profile;
using UnityEngine;
using UnityEngine.Rendering;

public static class BuildProfileGraphicsSettingsExample
{
    [MenuItem("Example/Log Shader Compilation For Active Build Profile")]
    static void LogShaderCompilationForActiveBuildProfile()
    {
        BuildProfile profile = BuildProfile.GetActiveBuildProfile();
        if (profile == null)
            return;

        // Copy the global graphics settings into the build profile, unless it already has its own.
        var graphicsSettings = profile.GetComponent<BuildProfileGraphicsSettings>();
        if (graphicsSettings == null)
            graphicsSettings = profile.CreateComponent<BuildProfileGraphicsSettings>();

        // Change the build profile's value. The global graphics settings keep their value.
        graphicsSettings.logWhenShaderIsCompiled = true;

        // While the build profile is active, GraphicsSettings returns the build profile's value.
        Debug.Log($"Log when shader is compiled for {profile.name}: {GraphicsSettings.logWhenShaderIsCompiled}");
    }

    [MenuItem("Example/Use Global Graphics Settings For Active Build Profile")]
    static void UseGlobalGraphicsSettingsForActiveBuildProfile()
    {
        BuildProfile profile = BuildProfile.GetActiveBuildProfile();
        if (profile == null || profile.GetComponent<BuildProfileGraphicsSettings>() == null)
            return;

        // Remove the build profile's own graphics settings, so that it uses the global graphics settings again.
        profile.RemoveComponent<BuildProfileGraphicsSettings>();
    }
}
```

Additional Resources: [BuildProfile](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofile.md), [GraphicsSettings](/engine/7000.0/script-reference/unityengine/rendering/graphicssettings.md), [EditorGraphicsSettings](/engine/7000.0/script-reference/unityeditor/rendering/editorgraphicssettings.md).

## Properties

| Property                                                                                                                                                 | Description                                                                                                          |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [cameraRelativeLightCulling](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofilegraphicssettings/camerarelativelightculling.md)       | Whether Unity uses the camera position instead of the world space origin as the reference point for culling lights.  |
| [cameraRelativeShadowCulling](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofilegraphicssettings/camerarelativeshadowculling.md)     | Whether Unity uses the camera position instead of the world space origin as the reference point for culling shadows. |
| [lightProbeOutsideHullStrategy](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofilegraphicssettings/lightprobeoutsidehullstrategy.md) | How Unity lights a Renderer that uses Light Probes but is outside the Light Probe tetrahedral hull.                  |
| [logWhenShaderIsCompiled](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofilegraphicssettings/logwhenshaderiscompiled.md)             | Whether Unity adds a log entry each time it compiles a shader at runtime.                                            |
| [shaderBuildSettings](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofilegraphicssettings/shaderbuildsettings.md)                     | The shader build settings, such as shader defines and keyword declaration overrides.                                 |
| [videoShadersIncludeMode](/engine/7000.0/script-reference/unityeditor/build/profile/buildprofilegraphicssettings/videoshadersincludemode.md)             | Whether and when Unity includes video shaders in the build.                                                          |

## Inheritance

**Inherited Members:**

* [ScriptableObject.CreateInstance(string)](/engine/7000.0/script-reference/unityengine/scriptableobject/createinstance.md#createinstance\(string\))
* [ScriptableObject.CreateInstance(Type)](/engine/7000.0/script-reference/unityengine/scriptableobject/createinstance.md#createinstance\(type\))
* [ScriptableObject.CreateInstance\<T>()](/engine/7000.0/script-reference/unityengine/scriptableobject/createinstance.md)
* [Object.GetEntityId()](/engine/7000.0/script-reference/unityengine/object/getentityid.md)
* [Object.GetHashCode()](/engine/7000.0/script-reference/unityengine/object/gethashcode.md)
* [Object.InstantiateAsync\<T>(T)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.Instantiate(Object, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion\))
* [Object.Instantiate(Object, Vector3, Quaternion, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion-transform\))
* [Object.Instantiate(Object)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object\))
* [Object.Instantiate(Object, Scene)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-scene\))
* [Object.Instantiate\<T>(T, InstantiateParameters)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, InstantiateParameters)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate(Object, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform\))
* [Object.Instantiate(Object, Transform, bool)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform-bool\))
* [Object.Instantiate\<T>(T)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform, bool)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Destroy(Object, float)](/engine/7000.0/script-reference/unityengine/object/destroy.md)
* [Object.DestroyImmediate(Object, bool)](/engine/7000.0/script-reference/unityengine/object/destroyimmediate.md)
* [Object.FindObjectsByType(Type)](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type\))
* [Object.FindObjectsByType(Type, FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectsinactive\))
* [Object.DontDestroyOnLoad(Object)](/engine/7000.0/script-reference/unityengine/object/dontdestroyonload.md)
* [Object.FindAnyObjectByType\<T>()](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(\))
* [Object.FindAnyObjectByType\<T>(FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(findobjectsinactive\))
* [Object.FindObjectsByType\<T>()](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(\))
* [Object.FindObjectsByType\<T>(FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectsinactive\))
* [Object.FindAnyObjectByType(Type)](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type\))
* [Object.FindAnyObjectByType(Type, FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type-findobjectsinactive\))
* [Object.ToString()](/engine/7000.0/script-reference/unityengine/object/tostring.md)
* [Object.name](/engine/7000.0/script-reference/unityengine/object/name.md)
* [Object.hideFlags](/engine/7000.0/script-reference/unityengine/object/hideflags.md)

### Operators

| Operator                                                                           | Description                                                             |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [operator ==](/engine/7000.0/script-reference/unityengine/object/op-equality.md)   | Compares two object references to see if they refer to the same object. |
| [bool](/engine/7000.0/script-reference/unityengine/object/op-implicit.md)          | Determines whether the object exists.                                   |
| [operator !=](/engine/7000.0/script-reference/unityengine/object/op-inequality.md) | Compares if two objects refer to a different object.                    |
