ColorVisionDeficiencySeverity
ColorVisionDeficiencySeverity
#Overview
name: ColorVisionDeficiencySeverity
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ColorVisionDeficiencySeverity is to control the intensity of color vision deficiency simulation or correction in the Unreal Engine editor’s accessibility features. This setting is primarily used for visualizing how the game or application would appear to users with different types of color blindness.
This setting variable is mainly relied upon by the Unreal Engine’s editor subsystem, specifically within the accessibility features of the editor’s user interface. It’s also used in the Slate rendering system, which is responsible for the engine’s user interface rendering.
The value of this variable is set in the Editor Style Settings (UEditorStyleSettings class). It can be modified through the editor’s settings interface or programmatically.
ColorVisionDeficiencySeverity interacts with several other variables:
- ColorVisionDeficiencyPreviewType: Determines the type of color vision deficiency being simulated.
- bColorVisionDeficiencyCorrection: Enables or disables color correction for the simulated deficiency.
- bColorVisionDeficiencyCorrectionPreviewWithDeficiency: Controls whether to show the corrected colors as they would appear to someone with the specified color vision deficiency.
Developers should be aware that:
- The severity is clamped between 0 and 10, as indicated by the meta data in the property declaration.
- Changes to this variable take effect immediately in the editor, updating the color vision deficiency simulation in real-time.
- This setting affects only the editor view and doesn’t impact the final game build unless explicitly implemented for in-game use.
Best practices when using this variable include:
- Use it in conjunction with other color vision deficiency settings for a comprehensive accessibility testing environment.
- Regularly test your game or application with different severity levels to ensure content remains clear and understandable across various color vision deficiency conditions.
- Consider providing in-game options for color vision deficiency correction if your game heavily relies on color-based gameplay elements.
- Remember that this is a simulation tool and should be used alongside feedback from users with actual color vision deficiencies for the best results.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:84, section: [/Script/UnrealEd.EditorStyleSettings]
- INI Section:
/Script/UnrealEd.EditorStyleSettings
- Raw value:
3
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorStyleSettings.h:66
Scope (from outer to inner):
file
class class UEditorStyleSettings : public UObject
Source code excerpt:
UPROPERTY(EditAnywhere, config, Category = "Accessibility", meta=(ClampMin=0, ClampMax=10))
int32 ColorVisionDeficiencySeverity;
/** Shifts the color spectrum to the visible range based on the current ColorVisionDeficiencyPreviewType */
UPROPERTY(EditAnywhere, config, Category = "Accessibility")
bool bColorVisionDeficiencyCorrection;
/** If you're correcting the color deficiency, you can use this to visualize what the correction looks like with the deficiency. */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:847
Scope (from outer to inner):
file
function void UEditorEngine::InitEditor
Source code excerpt:
const UEditorStyleSettings* EditorSettings = GetDefault<UEditorStyleSettings>();
const EColorVisionDeficiency DeficiencyType = EditorSettings->ColorVisionDeficiencyPreviewType;
const int32 Severity = EditorSettings->ColorVisionDeficiencySeverity;
const bool bCorrectDeficiency = EditorSettings->bColorVisionDeficiencyCorrection;
const bool bShowCorrectionWithDeficiency = EditorSettings->bColorVisionDeficiencyCorrectionPreviewWithDeficiency;
FSlateApplication::Get().GetRenderer()->SetColorVisionDeficiencyType(DeficiencyType, Severity, bCorrectDeficiency, bShowCorrectionWithDeficiency);
}
UEditorStyleSettings* StyleSettings = GetMutableDefault<UEditorStyleSettings>();
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:1076
Scope (from outer to inner):
file
function void UEditorEngine::HandleSettingChanged
Source code excerpt:
const UEditorStyleSettings* EditorSettings = GetDefault<UEditorStyleSettings>();
const EColorVisionDeficiency DeficiencyType = EditorSettings->ColorVisionDeficiencyPreviewType;
const int32 Severity = EditorSettings->ColorVisionDeficiencySeverity;
const bool bCorrectDeficiency = EditorSettings->bColorVisionDeficiencyCorrection;
const bool bShowCorrectionWithDeficiency = EditorSettings->bColorVisionDeficiencyCorrectionPreviewWithDeficiency;
FSlateApplication::Get().GetRenderer()->SetColorVisionDeficiencyType(DeficiencyType, Severity, bCorrectDeficiency, bShowCorrectionWithDeficiency);
}
if (Name == FName("SelectionColor") || Name == NAME_None)
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:1168
Scope (from outer to inner):
file
function void UEditorEngine::Init
lambda-function
Source code excerpt:
const UEditorStyleSettings* EditorSettings = GetDefault<UEditorStyleSettings>();
const EColorVisionDeficiency DeficiencyType = EditorSettings->ColorVisionDeficiencyPreviewType;
const int32 Severity = EditorSettings->ColorVisionDeficiencySeverity;
const bool bCorrectDeficiency = EditorSettings->bColorVisionDeficiencyCorrection;
const bool bShowCorrectionWithDeficiency = EditorSettings->bColorVisionDeficiencyCorrectionPreviewWithDeficiency;
FSlateApplication::Get().GetRenderer()->SetColorVisionDeficiencyType(DeficiencyType, Severity, bCorrectDeficiency, bShowCorrectionWithDeficiency);
}
});
#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRenderer.cpp:761
Scope (from outer to inner):
file
class class FCompositeShaderBase : public FGlobalShader
function FCompositeShaderBase
Source code excerpt:
OutputDevice.Bind(Initializer.ParameterMap, TEXT("OutputDevice"));
ColorVisionDeficiencyType.Bind(Initializer.ParameterMap, TEXT("ColorVisionDeficiencyType"));
ColorVisionDeficiencySeverity.Bind(Initializer.ParameterMap, TEXT("ColorVisionDeficiencySeverity"));
bCorrectDeficiency.Bind(Initializer.ParameterMap, TEXT("bCorrectDeficiency"));
bSimulateCorrectionWithDeficiency.Bind(Initializer.ParameterMap, TEXT("bSimulateCorrectionWithDeficiency"));
}
FCompositeShaderBase() = default;
void SetParametersBase(FRHIBatchedShaderParameters& BatchedParameters, FRHITexture* UITextureRHI, FRHITexture* UITextureWriteMaskRHI, FRHITexture* ColorSpaceLUTRHI)
#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRenderer.cpp:786
Scope (from outer to inner):
file
class class FCompositeShaderBase : public FGlobalShader
function void SetColorDeficiencyParamsBase
Source code excerpt:
{
SetShaderValue(BatchedParameters, ColorVisionDeficiencyType, (float)DeficiencyType);
SetShaderValue(BatchedParameters, ColorVisionDeficiencySeverity, (float)Severity);
SetShaderValue(BatchedParameters, bCorrectDeficiency, bCorrect ? 1.0f : 0.0f);
SetShaderValue(BatchedParameters, bSimulateCorrectionWithDeficiency, bShowCorrectionWithDeficiency ? 1.0f : 0.0f);
}
static const TCHAR* GetSourceFilename()
{
#Loc: <Workspace>/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateShaders.h:457
Scope (from outer to inner):
file
class class FSlatePostProcessColorDeficiencyPS : public FSlateElementPS
function FSlatePostProcessColorDeficiencyPS
Source code excerpt:
{
ColorVisionDeficiencyType.Bind(Initializer.ParameterMap, TEXT("ColorVisionDeficiencyType"));
ColorVisionDeficiencySeverity.Bind(Initializer.ParameterMap, TEXT("ColorVisionDeficiencySeverity"));
bCorrectDeficiency.Bind(Initializer.ParameterMap, TEXT("bCorrectDeficiency"));
bSimulateCorrectionWithDeficiency.Bind(Initializer.ParameterMap, TEXT("bSimulateCorrectionWithDeficiency"));
}
void SetColorRules(FRHIBatchedShaderParameters& BatchedParameters, bool bCorrect, EColorVisionDeficiency DeficiencyType, int32 Severity)
{
SetShaderValue(BatchedParameters, ColorVisionDeficiencyType, (float)DeficiencyType);
SetShaderValue(BatchedParameters, ColorVisionDeficiencySeverity, (float)Severity);
SetShaderValue(BatchedParameters, bCorrectDeficiency, bCorrect ? 1.0f : 0.0f);
}
void SetShowCorrectionWithDeficiency(FRHIBatchedShaderParameters& BatchedParameters, bool bShowCorrectionWithDeficiency)
{
SetShaderValue(BatchedParameters, bSimulateCorrectionWithDeficiency, bShowCorrectionWithDeficiency ? 1.0f : 0.0f);