Accessibility

Color Blindness

Simulating Color Blindness In Unity (URP)

../_images/color_blind_example_result_0.PNG ../_images/color_blind_example_result_1.PNG

Quickstart

Note

The following tutorial is for projects using the Universal Render Pipeline. We take advantage of URP’s Post Processing Color Lookup Override. For those using the Built-in Render Pipeline, check out the Colorblind Effect Package

  1. Download the Color Blindness Simulator Unity Package Here: ColorBlindnessSimulator.unitypackage. This package contains LUTs for a variety of color blindness conditions. If you would like to learn how to create your own color blindness LUTs, see Build Your Color Lookup Textures From Scratch.

  2. Import the Unity Package into your URP project by going to Assets > Import Package > Custom Package

  3. This example uses LUTs with a height of 32 pixels. To make sure URP can accept this size go to your URP asset and under Post-processing set the LUT size to 32.

    ../_images/color_blind_example_4.PNG
  4. In a new scene, select the main camera and under the Rendering Setting enable Post Processing. Also make sure the post processing effect is toggled in the scene view. We use URP post processing to achieve the color blindness effect so this way you will be able to see the post processing effects in the scene view as well as the game view.

    ../_images/color_blind_example_2.PNG ../_images/color_blind_example_3.png
  5. Next create a new global volume (Right click in the Hierarchy > Volume > Global Volume)

  6. Inside the Volume inspector, next to the profile field click the New button.

    ../_images/color_blind_example_0.PNG
  7. Click the Add Override button and select Color Lookup

  8. Inside the Color Lookup menu check the boxes for Lookup Texture and Contribution and set the Contribution to 1.

    ../_images/color_blind_example_1.PNG
  9. At this point you can drag in any LUT texture into the Lookup Texture slot and see its effects in the Scene View and Game View.

    ../_images/color_blind_example_result_1.PNG

    Note

    You may encounter the following error:

    Error

    “Invalid lookup texture. It must be a non-sRGB 2D texture with the same size as set in the Universal Render Pipeline Settings

    To fix this:

    • Make sure that you did step 3 properly and set Post-processing set the LUT size to 32.

    • Make sure that you are using the correct URP asset (Go to Edit > Project Settings > Graphics > Scriptable Render Pipeline Settings)

      ../_images/color_blind_example_5.PNG
    • Make sure the LUT images are imported with sRGB (Color Texture) disabled. (The package contains a preset called _Lut_Texture_Importer_Preset you can use)

      ../_images/color_blind_example_6.PNG
  10. If you want to affect colors inside the canvas, you need to set the canvas object’s Render Mode to Screen Space Camera** and select the Main Camera as the render camera. If you find your UI elements are now behind objects in your scene, you can set the canvas’s Plane Distance setting to a small value.

    ../_images/color_blind_example_7.PNG

Build Your Color Lookup Textures From Scratch

  1. Download a neutral color lookup table (color LUT). You can find links to some at:

    If you cannot find any LUTs you like or the links above no longer work, you can copy the LUTs below:

    If you are already using an LUT in your game just use that one.

  2. Visit a website that allows you to simulate color blindness on uploaded images. For this exercise I used the one provided by Pilestone

  3. Upload the LUT, pass it through the color blindness filters and download the resulting images.